by king_geedorah · 6mo ago · 0 comments
That's the essence of C++: you're basically trading ergonomics for compile times.
#define E_LIST(X) \
X(V0) X(V1) X(V2) X(V3)
DEFINE_ENUM(E, E_LIST)
That's not how I want to declare my enums...The underlying machinery implementation is going to be much uglier and complex, though.
#define MY_ENUM(x) x(MY_A) x(MY_B) x(MY_C)
enum my_enum { MY_ENUM(ENUM_ENTRIES) };
static const char *my_enum_names[] = { MY_ENUM(ENUM_NAMES) };
but one could also make it even more compact if one cared.