Struct EnableBitmaskOps¶
-
template<typename
T
>
structEnableBitmaskOps
¶ Template operators to add typesafe bitwise operators to enum classes. These are intended for use with mask types, so shift operators are not provided as they can lead to invalid bits being set.
To avoid nest namespace issues, ENABLE_BITMASK_OPS must be used outside any namespaces
Example Usage: namespace my_namespace { enum class MyEnum : uint8_t { kEmpty = 0x00, kSomething = 0x01, kAnother = 0x02 }; } // namespace my_namespace
ENABLE_BITMASK_OPS(::my_namespace::MyEnum) MyEnum e = MyEnum::kSomething & MyEnum::kAnother;
Public Static Attributes
-
constexpr bool
enable
= false¶
-
constexpr bool