|
| constexpr | flags () noexcept=default |
| | Default constructor, initializes to empty flags (zero).
|
| |
| constexpr | flags (E e) noexcept |
| | Constructs from a single enum value.
|
| |
| constexpr flags | operator| (flags other) const noexcept |
| | Combines flags using bitwise OR.
|
| |
| constexpr flags & | operator|= (flags other) noexcept |
| | Combines flags in-place using bitwise OR.
|
| |
| constexpr flags | operator& (flags other) const noexcept |
| | Intersects flags using bitwise AND.
|
| |
| constexpr flags & | operator&= (flags other) noexcept |
| | Intersects flags in-place using bitwise AND.
|
| |
| constexpr flags | operator^ (flags other) const noexcept |
| | Toggles flags using bitwise XOR.
|
| |
| constexpr flags & | operator^= (flags other) noexcept |
| | Toggles flags in-place using bitwise XOR.
|
| |
| constexpr flags | operator- (flags other) const noexcept |
| | Clears specific flags (set difference).
|
| |
| constexpr flags & | operator-= (flags other) noexcept |
| | Clears specific flags in-place (set difference).
|
| |
| constexpr flags | operator~ () const noexcept |
| | Computes the bitwise complement.
|
| |
| constexpr bool | contains (flags other) const noexcept |
| | Checks if all specified flags are set.
|
| |
| constexpr bool | contains_any (flags other) const noexcept |
| | Checks if any of the specified flags are set.
|
| |
| constexpr bool | empty () const noexcept |
| | Checks if no flags are set.
|
| |
| constexpr | operator bool () const noexcept |
| | Explicit conversion to bool.
|
| |
| constexpr underlying | value () const noexcept |
| | Returns the underlying integral value.
|
| |
| constexpr bool | operator== (flags const &) const noexcept=default |
| | Equality comparison between flags objects.
|
| |
| constexpr bool | operator== (E e) const noexcept |
| | Equality comparison with an individual enum value.
|
| |
template<flag_enum E>
class idfxx::flags< E >
Type-safe set of flags from a scoped enum.
Provides type-safe bitflag operations with full operator support. Individual enum values implicitly convert to flags<E>, allowing natural syntax like: auto f = my_flag::a | my_flag::b;
All operations are constexpr and marked [[nodiscard]] to prevent accidental misuse. The class provides zero-overhead abstractions over raw bitwise operations.
Requires opt-in via:
template<> inline constexpr bool idfxx::enable_flags_operators<MyEnum> = true;
- Template Parameters
-
| E | The flag enum type (must satisfy flag_enum concept). |
Definition at line 88 of file flags.hpp.