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.pw::EnumTraits by hand. Specializations are identified by an internal tag that only the code generator emits, so a hand-written one is not recognized by pw::has_enum_traits_v and is rejected by pw::IsValidEnum. To get traits for an enum, register it with PW_ENUM.