#include <type_traits>
Go to the source code of this file.
|
template<typename T > |
constexpr bool | IsEnumFlag (T) |
|
template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr> |
constexpr T | operator& (T left, T right) |
|
template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr> |
constexpr T & | operator&= (T &left, T right) |
|
template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr> |
constexpr T | operator| (T left, T right) |
|
template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr> |
constexpr T & | operator|= (T &left, T right) |
|
template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr> |
constexpr T | operator~ (T value) |
|
◆ DEFINE_ENUM_FLAG
#define DEFINE_ENUM_FLAG |
( |
|
enumType | ) |
constexpr bool IsEnumFlag(enumType) { return true; } |
◆ IsEnumFlag()
template<typename T >
constexpr bool IsEnumFlag |
( |
T |
| ) |
|
|
constexpr |
◆ operator&()
template<typename T , std::enable_if_t<
EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator& |
( |
T |
left, |
|
|
T |
right |
|
) |
| |
|
inlineconstexpr |
36{
37 return static_cast<T>(static_cast<std::underlying_type_t<T>>(left) & static_cast<std::underlying_type_t<T>>(right));
38}
◆ operator&=()
template<typename T , std::enable_if_t<
EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T & operator&= |
( |
T & |
left, |
|
|
T |
right |
|
) |
| |
|
inlineconstexpr |
42{
43 return left = left & right;
44}
◆ operator|()
template<typename T , std::enable_if_t<
EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator| |
( |
T |
left, |
|
|
T |
right |
|
) |
| |
|
inlineconstexpr |
48{
49 return static_cast<T>(static_cast<std::underlying_type_t<T>>(left) | static_cast<std::underlying_type_t<T>>(right));
50}
◆ operator|=()
template<typename T , std::enable_if_t<
EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T & operator|= |
( |
T & |
left, |
|
|
T |
right |
|
) |
| |
|
inlineconstexpr |
54{
55 return left = left | right;
56}
◆ operator~()
template<typename T , std::enable_if_t<
EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator~ |
( |
T |
value | ) |
|
|
inlineconstexpr |
60{
61 return static_cast<T>(~static_cast<std::underlying_type_t<T>>(value));
62}