
2010/5/13 Bartosz Marcinkiewicz <bma@epcon.pl>:
Hello,
I would like to have a macro which could be used like this:
STRING_TO_TYPE( MyType )
which would yield:
typedef mpl::string<'M','y','T','y','p','e'> MyType_id_t;
Any ideas how to implement something like that?
I also researched something similar about 1 year ago and concluded that it is not possible (but I think CHAOS supports a string-type preprocessor data structure which I did not investigate because it is not available for all compilers). This can be done instead if you are willing to wrap the single characters between parenthesis: STRING_TO_TYPE( (M)(y)(T)(y)(p)(e) ) If this would work for your application, I can post the code for this macro (or just look at BOOST_PP_SEQ_FOLD_LEFT() or similar and program it yourself). Let me know. Regards, -- Lorenzo