the question can sound a bit unusual. Let's take a POD struct:
struct MyStruct
{
int myInt;
double myDouble;
AnotherPOD* myPointer;
};
The compiler knows the list of available data members. Do you know any way to get list of data member name (and type) either at compile time (better) or at run time?
I have a huge amount of POD structs and I would like to automate the creation of operator<<.
I know I could create a parser for the header files, create some files and compile those. However, I am sure the compiler has already had this information and I would like to exploit it.
Any ideas?
Thanks