
27 Jun
2011
27 Jun
'11
9:34 p.m.
On 06/27/2011 03:39 PM, lcaminiti wrote:
NOTE: This is more a curiosity than anything else because I don't actually have a real use case for these spaced-strings. I researched them because there was a request for a macro like:
STRING_TO_TYPE( MyType ) // expand to: typedef mpl::string<'M','y','T','y','p','e'> MyType_id_t; http://boost.2283326.n4.nabble.com/mpl-string-to-type-conversion-td2668494.h...
As far as I know, such a macro cannot be implemented but both the following macros can be done (and I'd prefer somewhat (1) over (2)):
SP_STRING_TO_TYPE( M y T y p e ) // (1) SEQ_STRING_TO_TYPE( (M)(y)(T)(y)(p)(e) ) // (2)
FYI, You can do STRING_TO_TYPE("MyType") or STRING_TO_TYPE(MyType) in C++0x by expanding it to "MyType"[0], "MyType"[1] etc.