How in C++03 get in compile time number of members of chosen struct? I was experimenting with BOOST_FUSION_ADAPT_STRUCT
but I did't get any working example.
I want to generate switch statement in compile time, where there will be one case per each member. So lets say we have struct with 3 members then I want to generate this switch:
switch(val)
{
case 0:
break;
case 1:
break;
case 2:
break;
}
In each statement I will call template function with some parameters. One of this parameters is a member of structure.
How I can do something like this?