C++ template meta-programming, number of member variables?
- by aaa
hello
Is it possible in C++ to determine number of variables/fields in the generic class?
for example
// suppose I need metaclass number_members determines number of members
struct example { int i, j; };
assert(number_members::value==2);
I looked through mpl but could not find implementation
thanks.