added enum contains functoin

This commit is contained in:
janis 2022-08-11 08:19:28 +01:00
parent d6608aa6b4
commit b2073da604

View file

@ -53,6 +53,11 @@ template <enum_type E> constexpr auto is_empty(const E &value) -> bool {
return std::to_underlying(value) == 0;
}
template <enum_type E>
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;