Loading...
Searching...
No Matches
Go to the documentation of this file.
5#define DI_DEFINE_ENUM_BITWISE_OPERATIONS(Type) \
6 static_assert(::di::concepts::Enum<Type>); \
7 constexpr auto operator~(Type a)->Type { \
8 return static_cast<Type>(~::di::util::to_underlying(a)); \
10 constexpr auto operator|(Type a, Type b)->Type { \
11 return static_cast<Type>(::di::util::to_underlying(a) | ::di::util::to_underlying(b)); \
13 constexpr auto operator&(Type a, Type b)->Type { \
14 return static_cast<Type>(::di::util::to_underlying(a) & ::di::util::to_underlying(b)); \
16 constexpr auto operator^(Type a, Type b)->Type { \
17 return static_cast<Type>(::di::util::to_underlying(a) ^ ::di::util::to_underlying(b)); \
19 constexpr auto operator|=(Type& a, Type b)->Type& { \
22 constexpr auto operator&=(Type& a, Type b)->Type& { \
25 constexpr auto operator^=(Type& a, Type b)->Type& { \
28 constexpr auto operator!(Type a)->bool { \
29 return !::di::util::to_underlying(a); \