ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
enumops.prepro.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of the \aliblong.
4///
5/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6/// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
8#ifndef HPP_ALIB_ENUMOPS_PP
9#define HPP_ALIB_ENUMOPS_PP
10#pragma once
11
12#ifndef INL_ALIB
13# include "alib/alib.inl"
14#endif
15
16// #################################################################################################
17// Symbols introduced by module ALib.Enums
18// #################################################################################################
19#define ALIB_ENUMS_MAKE_ARITHMETICAL(TEnum) \
20namespace alib::enumops { \
21template<> struct ArithmeticalTraits<TEnum> : std::true_type {}; } \
22
23#define ALIB_ENUMS_MAKE_BITWISE(TEnum) \
24namespace alib::enumops { \
25template<> \
26struct BitwiseTraits<TEnum> : std::true_type {}; }
27
28#define ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END(TEnum, StartElement, StopElement ) \
29namespace alib::enumops { \
30template<> struct IterableTraits<TEnum> : std::true_type \
31{ \
32 static constexpr TEnum Begin = StartElement; \
33 static constexpr TEnum End = StopElement; \
34};}
35
36#define ALIB_ENUMS_MAKE_ITERABLE(TEnum, StopElement ) \
37ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END( TEnum, TEnum(0), StopElement )
38
39#endif // HPP_ALIB_ENUMOPS_PP
40