added enum contains functoin
This commit is contained in:
parent
d6608aa6b4
commit
b2073da604
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue