Is it possible in C ++ to determine the number of variables / fields in a common class? eg
// suppose I need metaclass number_members determines number of members struct example { int i, j; }; assert(number_members<example>::value==2);
I looked at mpl but could not find an implementation.
thanks.
c ++ templates metaprogramming
Anycorn
source share