Sebastian,
preprocessor can not do parsing of C++ tokens for you, so it can not strip template paramters. You approach should be reversed:
SOME_MAGIC_DEF_MACRO(myVec, type_seq) should take a boost preprocessor sequence and genrate a template class instantiation and your pod type.
Macro input would be:
SOME_MAGIC_DEF_MACRO(myVec, ((int)(char)(double)(size_t)(whatever_type)))
This macro expansion should result in:
fusion::vector<int,char,double,size_t,whatever_type> myVec;
and
struct myVec_pod
{
int v1;
double v2;
...
};
BOOST_PP_SEQ_FOR_EACH or BOOST_PP_SEQ_FOLD_LEFT are your friends.
With Kind Regards,
Ovanes
Hi there!
The fusion library seems to be the choice for handling tuple-like data
in C++. However, for some reasons I would like to be able to transform a
fusion vector into a pod object. Something like:
fusion::vector<int, double, float> myVec;
SOME_MAGIC_ADAPTER_MACRO(myVec)
The macro or whatever should then turn the vector into
struct myVec_pod {
int v1;
double v2;
float v3;
};
or similar. Is this possible?
Greetings,
Sebastian Weber
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users