template <typename T>
struct EnumTraits
Compile-time metadata about an enum type.
The primary template is undefined. Specializations are generated
automatically for enums registered with `PW_ENUM`.
Specializations provide the following members. Enumerators that share a
value (aliases) are treated as a single *distinct value*.
- `enum_type` --- the enum type itself.
- `underlying_type` --- `std::underlying_type_t
<enum
_type>`.
- `kName` --- unqualified enum name, e.g. `"MyEnum"`.
- `kFullyQualifiedName` --- fully qualified enum name, e.g.
`"::my::ns::MyEnum"`.
- `kTokenDomain` --- the `pw_tokenizer` domain the enum is tokenized in.
- `kDistinctValueCount` --- number of distinct values; equals
`kValues.size()`.
- `kIsContiguous` --- whether the distinct values cover every integer from
`kMin` to `kMax` with no gaps.
- `kMin` / `kMax` --- smallest and largest enumerator values.
- `kValues` --- `std::array
<enum
_type, kDistinctValueCount>` of the distinct
values in ascending order.
- `IsValid(value)` --- returns whether an enumerator or integer value is a
valid enumerator; see `pw::IsValidEnum`.
- `ToString(value)` --- returns the string representation of `value`; see
`pw::EnumToString`.