TrinityCore
EnumFlag.h File Reference
#include <type_traits>
+ Include dependency graph for EnumFlag.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  EnumFlag< T >
 

Namespaces

namespace  EnumTraits
 

Macros

#define DEFINE_ENUM_FLAG(enumType)   constexpr bool IsEnumFlag(enumType) { return true; }
 

Typedefs

template<typename T >
using EnumTraits::IsFlag = std::conjunction< std::is_enum< T >, std::integral_constant< bool, IsEnumFlag(T{})> >
 

Functions

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)
 

Macro Definition Documentation

◆ DEFINE_ENUM_FLAG

#define DEFINE_ENUM_FLAG (   enumType)    constexpr bool IsEnumFlag(enumType) { return true; }

Definition at line 26 of file EnumFlag.h.

Function Documentation

◆ IsEnumFlag()

template<typename T >
constexpr bool IsEnumFlag ( )
constexpr

Definition at line 24 of file EnumFlag.h.

◆ operator&()

template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator& ( left,
right 
)
inlineconstexpr

Definition at line 35 of file EnumFlag.h.

◆ operator&=()

template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T & operator&= ( T &  left,
right 
)
inlineconstexpr

Definition at line 41 of file EnumFlag.h.

◆ operator|()

template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator| ( left,
right 
)
inlineconstexpr

Definition at line 47 of file EnumFlag.h.

◆ operator|=()

template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T & operator|= ( T &  left,
right 
)
inlineconstexpr

Definition at line 53 of file EnumFlag.h.

◆ operator~()

template<typename T , std::enable_if_t< EnumTraits::IsFlag< T >::value, std::nullptr_t > = nullptr>
constexpr T operator~ ( value)
inlineconstexpr

Definition at line 59 of file EnumFlag.h.