diff --git a/AK/EnumBits.h b/AK/EnumBits.h index c97fc47527b..443d019809d 100644 --- a/AK/EnumBits.h +++ b/AK/EnumBits.h @@ -58,6 +58,13 @@ return lhs; \ } \ \ + Prefix inline void operator|=(Enum volatile& lhs, Enum rhs) \ + { \ + using Type = UnderlyingType; \ + lhs = static_cast( \ + static_cast(lhs) | static_cast(rhs)); \ + } \ + \ Prefix constexpr Enum& operator&=(Enum& lhs, Enum rhs) \ { \ using Type = UnderlyingType; \ @@ -66,6 +73,13 @@ return lhs; \ } \ \ + Prefix inline void operator&=(Enum volatile& lhs, Enum rhs) \ + { \ + using Type = UnderlyingType; \ + lhs = static_cast( \ + static_cast(lhs) & static_cast(rhs)); \ + } \ + \ Prefix constexpr Enum& operator^=(Enum& lhs, Enum rhs) \ { \ using Type = UnderlyingType; \ @@ -74,6 +88,13 @@ return lhs; \ } \ \ + Prefix inline void operator^=(Enum volatile& lhs, Enum rhs) \ + { \ + using Type = UnderlyingType; \ + lhs = static_cast( \ + static_cast(lhs) ^ static_cast(rhs)); \ + } \ + \ Prefix constexpr bool has_flag(Enum value, Enum mask) \ { \ using Type = UnderlyingType; \