MeshLib Documentation
Loading...
Searching...
No Matches
MRFlagOperators.h File Reference
#include <type_traits>

Go to the source code of this file.

Macros

#define MR_MAKE_FLAG_OPERATORS(T)   MR_MAKE_FLAG_OPERATORS_CUSTOM( static, T )
 
#define MR_MAKE_FLAG_OPERATORS_IN_CLASS(T)   MR_MAKE_FLAG_OPERATORS_CUSTOM( friend, T )
 
#define MR_MAKE_FLAG_OPERATORS_CUSTOM(prefix, T)
 

Macro Definition Documentation

◆ MR_MAKE_FLAG_OPERATORS

#define MR_MAKE_FLAG_OPERATORS ( T)    MR_MAKE_FLAG_OPERATORS_CUSTOM( static, T )

◆ MR_MAKE_FLAG_OPERATORS_CUSTOM

#define MR_MAKE_FLAG_OPERATORS_CUSTOM ( prefix,
T )
Value:
[[nodiscard, maybe_unused]] prefix constexpr T operator&( T a, T b ) { return T( ::std::underlying_type_t<T>( a ) & ::std::underlying_type_t<T>( b ) ); } \
[[nodiscard, maybe_unused]] prefix constexpr T operator|( T a, T b ) { return T( ::std::underlying_type_t<T>( a ) | ::std::underlying_type_t<T>( b ) ); } \
[[nodiscard, maybe_unused]] prefix constexpr T operator~( T a ) { return T( ~::std::underlying_type_t<T>( a ) ); } \
[[maybe_unused]] prefix constexpr T &operator&=( T &a, T b ) { return a = a & b; } \
[[maybe_unused]] prefix constexpr T &operator|=( T &a, T b ) { return a = a | b; } \
[[nodiscard, maybe_unused]] prefix constexpr T operator*( T a, bool b ) { return b ? a : T{}; } \
[[nodiscard, maybe_unused]] prefix constexpr T operator*( bool a, T b ) { return a ? b : T{}; } \
[[maybe_unused]] prefix constexpr T &operator*=( T &a, bool b ) { return a = a * b; }
constexpr A & operator*=(A &a, B b)
Definition MRImGuiVectorOperators.h:114
constexpr auto operator*(A a, B b)
Definition MRImGuiVectorOperators.h:107

◆ MR_MAKE_FLAG_OPERATORS_IN_CLASS

#define MR_MAKE_FLAG_OPERATORS_IN_CLASS ( T)    MR_MAKE_FLAG_OPERATORS_CUSTOM( friend, T )