C ++ time compilation

I looked at boost mpl :: string, but there seems to be no easy way to convert string literals to the mpl :: string format with a single quote. What I'm trying to do is to generate an XML implementation of some simple data structures using compile time strings at compile time. I try to make the macros generate the structures themselves and insert a constant "meta" field inside them containing the specified XML string.

+5
source share
2 answers

The short answer is no, there is no easy way. At least not using only C ++ at compile time. You can use scripts or some other code generator to create mpl::stringwith the correct literals. C ++ 0x will bring user-defined literals [1], which will make it easy to manipulate literals, specific characters, for example, using variable templates.

+3
source

All Articles