|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Stores a scoped enum in its underlying integer type. More...
#include <EnumReflect.hpp>
Public Types | |
| using | underlying_type = std::underlying_type_t<E> |
Public Member Functions | |
| constexpr | EnumByte () noexcept=default |
| Holds the zero value. | |
| constexpr | EnumByte (E value) noexcept |
Stores value in its underlying integer type. | |
| consteval | EnumByte (int zero) |
| Accepts the literal 0 as the empty flag set; flag enums only. | |
| constexpr | operator E () const noexcept |
| Converts back to the scoped enum. | |
Public Attributes | |
| underlying_type | raw {} |
| Underlying integer storage. | |
Stores a scoped enum in its underlying integer type.
Use as a struct field to keep one byte per enum value while the field still accepts the scoped enum directly, so callers write .method = EnergyMethod::RMS with no cast. Reads convert back to the scoped enum implicitly. Integers do not convert to the wrapper, so an out-of-range or wrong-family value cannot be stored by accident.
For a flag enum, one declared with MF_BITMASK_OPERATORS, the literal 0 also converts and means no flags, so .mods = 0 stays valid. Any other integer, and any non-constant integer, is a compile error.
| E | A scoped enumeration type. |
Definition at line 200 of file EnumReflect.hpp.