Is there a way to use C++ preprocessor stringification on variadic macro arguments?
-
11-11-2019 - |
Question
My guess is the answer to this question is no, but it would be awesome if there was a way. To clarify, assume I have the following macro:
#define MY_VARIADIC_MACRO(X...) // Does some stuff here in the macro definition
What I would like to do is somehow perform stringification on all the variables of X before passing it to a variadic function; the keyword here is before. I realize there's no way to really access the individual arguments from within the macro definition, but is there a way to stringify all the arguments, with maybe something like the following?
#define MY_VARIADIC_MACRO(X...) some_variadic_function("some string", #X)
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow