mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
AK+Kernel: Implement and use EnumBits has_any_flag()
This duplicates the old functionality of has_flag and will return true when any flags present in the mask are also in the value.
This commit is contained in:
parent
371911b1b5
commit
9715311837
3 changed files with 9 additions and 3 deletions
|
@ -78,4 +78,10 @@
|
|||
{ \
|
||||
using Type = UnderlyingType<Enum>; \
|
||||
return static_cast<Type>(value & mask) == static_cast<Type>(mask); \
|
||||
} \
|
||||
\
|
||||
Prefix constexpr bool has_any_flag(Enum value, Enum mask) \
|
||||
{ \
|
||||
using Type = UnderlyingType<Enum>; \
|
||||
return static_cast<Type>(value & mask) != 0; \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue