![]() |
VR-Forces Developer's Guide
|
Go to the source code of this file.
Classes | |
| struct | is_flag< T, bool > |
| struct | is_flag< T, true > |
Functions | |
| template<typename T , typename std::enable_if< is_flag< T >::value >::type * = nullptr> | |
| T | operator| (T lhs, T rhs) |
| template<typename T , typename std::enable_if< is_flag< T >::value >::type * = nullptr> | |
| T | operator& (T lhs, T rhs) |
Contains generic operator overrides for enum classes to allow for bitwise operations, e.g. | and &.
By default, enum classes do not support bitwise operations. This header partially addresses that by overriding the | and & bitwise operators in a generic way (using templates):
To make some enum class (some_enum) support bitwise operations: enum class some_enum : unsigned int { foo = 0x0001, bar = 0x0002, boo = 0x0004 };
You would do the following: #include <vrvUtil/DtEnumClassFlag.h>
template <> struct is_flag<some_enum> : std::true_type { };
| T operator| | ( | T | lhs, |
| T | rhs | ||
| ) |
| T operator& | ( | T | lhs, |
| T | rhs | ||
| ) |