TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_enum_operators.h File Reference

Go to the source code of this file.

Macros

#define TACHYON_ENUM_OPERATORS(EnumType)

Macro Definition Documentation

◆ TACHYON_ENUM_OPERATORS

#define TACHYON_ENUM_OPERATORS ( EnumType)
Value:
inline static EnumType operator|(EnumType a, EnumType b) { return static_cast<EnumType>(static_cast<std::underlying_type_t<EnumType>>(a) | static_cast<std::underlying_type_t<EnumType>>(b)); } \
inline static EnumType operator&(EnumType a, EnumType b) { return static_cast<EnumType>(static_cast<std::underlying_type_t<EnumType>>(a) & static_cast<std::underlying_type_t<EnumType>>(b)); } \
inline static EnumType operator^(EnumType a, EnumType b) { return static_cast<EnumType>(static_cast<std::underlying_type_t<EnumType>>(a) ^ static_cast<std::underlying_type_t<EnumType>>(b)); } \
inline static EnumType operator~(EnumType a) { return static_cast<EnumType>(~static_cast<std::underlying_type_t<EnumType>>(a)); } \
inline static bool operator!(EnumType a) { return static_cast<std::underlying_type_t<EnumType>>(a) == 0; } \
inline static bool operator==(EnumType a, EnumType b) { return static_cast<std::underlying_type_t<EnumType>>(a) == static_cast<std::underlying_type_t<EnumType>>(b); } \
inline static bool operator!=(EnumType a, EnumType b) { return static_cast<std::underlying_type_t<EnumType>>(a) != static_cast<std::underlying_type_t<EnumType>>(b); } \
inline static EnumType& operator|=(EnumType& a, EnumType b) { a = a | b; return a; } \
inline static EnumType& operator&=(EnumType& a, EnumType b) { a = a & b; return a; } \
inline static EnumType& operator^=(EnumType& a, EnumType b) { a = a ^ b; return a; }