Function e2str

Synopsis

#include <src/c4/enum.hpp>

template <class Enum>
const char * e2str(Enum e)

Description

get the c-string corresponding to an enum value

Mentioned in

Source

Lines 167-174 in src/c4/enum.hpp.

template<class Enum>
const char* e2str(Enum e)
{
    auto es = esyms<Enum>();
    auto *p = es.get(e);
    C4_CHECK_MSG(p != nullptr, "no valid enum pair name");
    return p->name;
}





Add Discussion as Guest

Log in