1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

AK: Change EnumBits has_flag() to check all flags in mask are present

Co-authored-by: Brian Gianforcaro <b.gianfo@gmail.com>
This commit is contained in:
Timothy 2021-07-14 21:57:11 +10:00 committed by Andreas Kling
parent 2df4d977e2
commit 03b76e4ba0

View file

@ -77,5 +77,5 @@
Prefix constexpr bool has_flag(Enum value, Enum mask) \ Prefix constexpr bool has_flag(Enum value, Enum mask) \
{ \ { \
using Type = UnderlyingType<Enum>; \ using Type = UnderlyingType<Enum>; \
return static_cast<Type>(value & mask) != 0; \ return static_cast<Type>(value & mask) == static_cast<Type>(mask); \
} }