Given a constant integer of compilation time (an object, not a macro), can I combine it with a string literal at compile time, possibly with a preprocessor?
For example, I can combine string literals by simply placing them next to each other:
bool do_stuff(std::string s);
do_stuff("This error code is ridiculously long so I am going to split it onto "
"two lines!");
Fine! But what if I add integer constants to the mix:
const unsigned int BAD_EOF = 1;
const unsigned int BAD_FORMAT = 2;
const unsigned int FILE_END = 3;
Is it possible to use a preprocessor to somehow associate this with string literals?
do_stuff("My error code is #" BAD_EOF "! I encountered an unexpected EOF!\n"
"This error code is ridiculously long so I am going to split it onto "
"three lines!");
If this is not possible, is it possible to mix constant strings with string literals? That is, if my error codes were strings, not unsignments?
And if none of them is impossible, then what is the shortest, cleanest way to relate this combination of string literals and numerical error codes?