diff --git a/source/utility.hpp b/source/utility.hpp index 9e2d2a7..8e1d821 100644 --- a/source/utility.hpp +++ b/source/utility.hpp @@ -48,6 +48,20 @@ typename std::enable_if::enable, Enum>::type oper return static_cast(static_cast(lhs) & static_cast(rhs)); } +template +typename std::enable_if::enable, bool>::type any(Enum lhs) +{ + using underlying = typename std::underlying_type::type; + return static_cast(lhs) != static_cast(0); +} + +template +typename std::enable_if::enable, bool>::type exact(Enum lhs, Enum rhs) +{ + using underlying = typename std::underlying_type::type; + return static_cast(lhs) == static_cast(rhs); +} + #define P_ENABLE_BITMASK_OPERATORS(x) \ template<> \ struct enable_bitmask_operators { \