mirror of
https://github.com/encounter/aurora.git
synced 2025-07-04 20:26:07 +00:00
Add True and False tests for bitwise enums
This commit is contained in:
parent
9d5c25978d
commit
4e6db26c9f
@ -60,6 +60,14 @@
|
||||
constexpr type operator~(type key) { \
|
||||
using T = std::underlying_type_t<type>; \
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user