mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
uitl/bitmask: Add 'has' function
This commit is contained in:
parent
47ef5dd995
commit
1d183ae680
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