indigoX
enum_class_bitwise.hpp File Reference
#include <type_traits>
+ Include dependency graph for enum_class_bitwise.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BITWISE_OPERATORS(enum_type)
 

Macro Definition Documentation

◆ BITWISE_OPERATORS

#define BITWISE_OPERATORS (   enum_type)
Value:
inline enum_type operator|(enum_type l, enum_type r) { \
using T = std::underlying_type_t<enum_type>; \
return static_cast<enum_type>(static_cast<T>(l) | static_cast<T>(r)); \
} \
inline enum_type &operator|=(enum_type &l, enum_type r) { \
using T = std::underlying_type_t<enum_type>; \
l = static_cast<enum_type>(static_cast<T>(l) | static_cast<T>(r)); \
return l; \
} \
inline enum_type operator&(enum_type l, enum_type r) { \
using T = std::underlying_type_t<enum_type>; \
return static_cast<enum_type>(static_cast<T>(l) & static_cast<T>(r)); \
} \
inline enum_type &operator&=(enum_type &l, enum_type r) { \
using T = std::underlying_type_t<enum_type>; \
l = static_cast<enum_type>(static_cast<T>(l) & static_cast<T>(r)); \
return l; \
}
Option operator|(Option l, Option r)
Definition: common.hpp:35
Option operator &(Option l, Option r)
Definition: common.hpp:40