Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TBitFlags.h File Reference
#include "Utility/traits.h"
#include <type_traits>
#include <initializer_list>
#include "Utility/TBitFlags.ipp"

Go to the source code of this file.

Classes

class  ph::TBitFlags< Value, Input >
 Manipulate a value type where each bit is a binary flag. More...
 

Namespaces

namespace  ph
 The root for all renderer implementations.
 

Macros

#define PH_DEFINE_INLINE_ENUM_FLAG_OPERATORS(EnumType)
 Defines operator | and operator & for EnumType.
 

Typedefs

template<CEnum EnumType>
using ph::TEnumFlags = TBitFlags<std::underlying_type_t<EnumType>, EnumType>
 Convenient type for using scoped/unscoped enum for bit flags.
 

Macro Definition Documentation

◆ PH_DEFINE_INLINE_ENUM_FLAG_OPERATORS

#define PH_DEFINE_INLINE_ENUM_FLAG_OPERATORS ( EnumType)
Value:
static_assert(::ph::CEnum<EnumType>, #EnumType " must be an enum type");\
\
inline constexpr EnumType operator | (const EnumType lhs, const EnumType rhs)\
{\
return ::ph::TEnumFlags<EnumType>({lhs, rhs}).getEnum();\
}\
\
inline constexpr EnumType operator & (const EnumType lhs, const EnumType rhs)\
{\
return ::ph::TEnumFlags<EnumType>({lhs}).intersectWith({rhs}).getEnum();\
}

Defines operator | and operator & for EnumType.