diff --git a/source/util/util-bitmask.hpp b/source/util/util-bitmask.hpp index fd8d8cb..05a87ce 100644 --- a/source/util/util-bitmask.hpp +++ b/source/util/util-bitmask.hpp @@ -54,6 +54,13 @@ typename std::enable_if::enable, bool>::type exac return static_cast(lhs) == static_cast(rhs); } +template +typename std::enable_if::enable, bool>::type has(Enum lhs, Enum rhs) +{ + using underlying = typename std::underlying_type::type; + return (lhs & rhs) == rhs; +} + #define P_ENABLE_BITMASK_OPERATORS(x) \ template<> \ struct enable_bitmask_operators { \