I have 2 enum types:
typedef enum {a=0, a1=3, a2=5} NX;
typedef enum {c=-1, c1=4, c2=7} NY;
I'd like to write an expression, that given a name of enum type/instance would return me the value of its first element. A possible solution is to always add fixed-name elements like
typedef enum {a=0, first=a, a1, a2, last=a2}
but, maybe there is a more elegant way.
Is there a way to get number of elements in the enum in run-time?