feat: add FlagsEnum::isEmpty for checking if a FlagsEnum is empty (#5550)

This commit is contained in:
pajlada
2024-08-18 12:22:41 +02:00
committed by GitHub
parent f3cae76abf
commit 66c3bc2112
3 changed files with 24 additions and 0 deletions
+6
View File
@@ -132,6 +132,12 @@ public:
return this->hasNone(FlagsEnum{flags...});
}
/// Returns true if the enum has no flag set (i.e. its underlying value is 0)
constexpr bool isEmpty() const noexcept
{
return static_cast<Int>(this->value_) == 0;
}
constexpr T value() const noexcept
{
return this->value_;