mirror of https://github.com/libAthena/athena.git
Add True and False tests for bitwise enums
This commit is contained in:
parent
0b3fd2b5af
commit
b40d3b17e5
|
@ -103,6 +103,14 @@ typedef struct stat64 atStat64_t;
|
||||||
constexpr type operator~(type key) { \
|
constexpr type operator~(type key) { \
|
||||||
using T = std::underlying_type_t<type>; \
|
using T = std::underlying_type_t<type>; \
|
||||||
return type(~static_cast<T>(key)); \
|
return type(~static_cast<T>(key)); \
|
||||||
|
} \
|
||||||
|
constexpr bool True(type key) { \
|
||||||
|
using T = std::underlying_type_t<type>; \
|
||||||
|
return static_cast<T>(key) != 0; \
|
||||||
|
} \
|
||||||
|
constexpr bool False(type key) { \
|
||||||
|
using T = std::underlying_type_t<type>; \
|
||||||
|
return static_cast<T>(key) == 0; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue