1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:37:34 +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:
Timothy 2021-07-14 21:59:22 +10:00 committed by Andreas Kling
parent 371911b1b5
commit 9715311837
3 changed files with 9 additions and 3 deletions

View file

@ -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; \
}