16template <
typename T, EnumKind Kind,
typename Structure = TypeList<>>
17 requires std::is_enum_v<T>
24 static constexpr auto get_enum_names() {
25 if constexpr (structure::size == 0) {
28 auto constexpr full_size = structure::invoke([]<
typename...
Range>() {
return ((
Range::size) + ...); });
46 constexpr static auto names = get_enum_names();
49 template <std::
size_t Idx = 0>
55 if (range::contains(value)) {
56 auto offset = value - range::min;
61 if constexpr (
Idx + 1 < structure::size) {
73 static_assert(structure::size == 1,
"Flag-like enum structure should only consist of one contiguous subrange");
87 if (width > range::max) {
T has_single_bit(T... args)
std::string code_for()
Definition repr:39
Structure structure
Definition accessor.h:19
static constexpr std::string_view search_name(underlying value)
Definition accessor.h:50
static std::string_view search_name(underlying value)
Definition accessor.h:70
static constexpr std::string_view get_name(T value)
Definition accessor.h:102
static constexpr auto get_names()
Definition accessor.h:109
static std::string_view search_name(underlying)
Definition accessor.h:96
static constexpr auto names
Definition accessor.h:46
static constexpr auto kind
Definition accessor.h:21
static constexpr auto get_names()
Definition accessor.h:107
static constexpr auto size
Definition range.h:15