12#ifndef __GEDIM_IOEnum_H
13#define __GEDIM_IOEnum_H
22template <auto V>
constexpr std::string_view
enum_name()
26 constexpr auto start =
f.find_last_of(
'<') + 1;
27 constexpr auto end =
f.find_last_of(
'>');
30 constexpr auto start =
f.find(
"V = ") + 4;
31 constexpr auto end =
f.find_first_of(
";]",
start);
36 if (
auto p = name.find_last_of(
':');
p != std::string_view::npos)
37 name.remove_prefix(
p + 1);
49 constexpr char c = n.front();
51 return c ==
'_' || (
'a' <=
c &&
c <=
'z') || (
'A' <=
c &&
c <=
'Z');
60template <
typename E,
int Min, std::size_t...
I>
constexpr auto make_table(std::index_sequence<I...>)
70 constexpr auto v =
static_cast<E>(
Min +
int(
I));
80template <
typename E,
int Min = 0,
int Max = 64>
constexpr std::string_view
enum_to_string(
E value)
84 for (
auto const &
e :
table)
Eigen column vector.
Definition Eigen_Array.hpp:23
constexpr std::string_view enum_name()
Definition IOEnum.hpp:22
constexpr auto make_table(std::index_sequence< I... >)
Definition IOEnum.hpp:60
constexpr std::string_view enum_to_string(E value)
Definition IOEnum.hpp:80
constexpr bool is_valid()
Definition IOEnum.hpp:42
Definition Eigen_Array.cpp:22
E value
Definition IOEnum.hpp:56
std::string_view name
Definition IOEnum.hpp:57