mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-01 07:43:02 +00:00
uitl/bitmask: Add 'has' function
This commit is contained in:
parent
132bdaf542
commit
2923c5bd49
1 changed files with 7 additions and 0 deletions
|
@ -54,6 +54,13 @@ typename std::enable_if<enable_bitmask_operators<Enum>::enable, bool>::type exac
|
|||
return static_cast<underlying>(lhs) == static_cast<underlying>(rhs);
|
||||
}
|
||||
|
||||
template<typename Enum>
|
||||
typename std::enable_if<enable_bitmask_operators<Enum>::enable, bool>::type has(Enum lhs, Enum rhs)
|
||||
{
|
||||
using underlying = typename std::underlying_type<Enum>::type;
|
||||
return (lhs & rhs) == rhs;
|
||||
}
|
||||
|
||||
#define P_ENABLE_BITMASK_OPERATORS(x) \
|
||||
template<> \
|
||||
struct enable_bitmask_operators<x> { \
|
||||
|
|
Loading…
Reference in a new issue