Commit 63011935 authored by Jack Andersen's avatar Jack Andersen

Add True and False tests for bitwise enums

parent 3a6ee9a7
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment