stringify arbitrary number of variables

Viewed 1902

For a single variable (or a given number of variables), it's easy to use macros to stringify variables. E.g. for 2 variables, I can do:

#define STRINGIFY(var1, var2) (std::string(#var1) + " " + #var2)

Is there a way to extend the above with either variadic macros or some other sort of compile-time trickery, to ultimately get a STRINGIFY function that accepts an arbitrary number of arguments?

6 Answers
Related