C++ template meta-programming, number of member variables?
No. C++ does not provide general introspection into structures.
You can try a C++0x std::tuple
, which has some of the features of a general POD struct
. Or, try to roll your own from the Boost MPL library. That would be a bit advanced if you're just getting started with C++.