diff --git a/include/enum.hpp b/include/enum.hpp index 5cb8414..eedacdb 100644 --- a/include/enum.hpp +++ b/include/enum.hpp @@ -53,6 +53,11 @@ template constexpr auto is_empty(const E &value) -> bool { return std::to_underlying(value) == 0; } +template +constexpr auto contains(const E &lhs, const E &rhs) -> bool { + return std::to_underlying(lhs & rhs) != 0; +} + } // namespace bitflag_operators using bitflag_operators::enum_type;