|
MeshLib
|
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
6#define MR_MAKE_FLAG_OPERATORS( T ) MR_MAKE_FLAG_OPERATORS_CUSTOM( static, T )
9#define MR_MAKE_FLAG_OPERATORS_IN_CLASS( T ) MR_MAKE_FLAG_OPERATORS_CUSTOM( friend, T )
12#define MR_MAKE_FLAG_OPERATORS_CUSTOM( prefix, T ) \
13 [[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 ) ); } \
14 [[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 ) ); } \
15 [[nodiscard, maybe_unused]] prefix constexpr T operator~( T a ) { return T( ~::std::underlying_type_t<T>( a ) ); } \
16 [[maybe_unused]] prefix constexpr T &operator&=( T &a, T b ) { return a = a & b; } \
17 [[maybe_unused]] prefix constexpr T &operator|=( T &a, T b ) { return a = a | b; } \
18 [[nodiscard, maybe_unused]] prefix constexpr T operator*( T a, bool b ) { return b ? a : T{}; } \
19 [[nodiscard, maybe_unused]] prefix constexpr T operator*( bool a, T b ) { return a ? b : T{}; } \
20 [[maybe_unused]] prefix constexpr T &operator*=( T &a, bool b ) { return a = a * b; }