6#ifndef EGT_DETAIL_ENUM_H
7#define EGT_DETAIL_ENUM_H
50 static const std::pair<T, char const*>
data[];
61 throw std::runtime_error(
"invalid enum");
69 if (std::strcmp(i.second, value) == 0)
72 throw std::runtime_error(
"invalid enum string");
80 if (i.second == value)
83 throw std::runtime_error(
"invalid enum string");
constexpr T enum_from_string(const char *value)
Convert a string to an enum value.
Definition enum.h:66
constexpr const char * enum_to_string(T const &e)
Convert an enum to a string.
Definition enum.h:55
EGT framework namespace.
Definition animation.h:24
When using enum_to_string() and enum_from_string(), this type needs to be defined and specialized to ...
Definition enum.h:48
static const std::pair< T, char const * > data[]
Enum string conversion map.
Definition enum.h:50