Preprocessor Abuse and Optional Parentheses
mikeash.com
mikeash.com
#define param foo, bar: baz
do_stuff_with(param, other things);
#undef param
or the parenthesized parameter: do_stuff_with((foo, bar: baz), other things);
On the other hand, passing the name of a macro lets you do even more arcane things, like passing a macro that in turn accepts arguments, and having the macro you pass it to call your macro. #define WRAP(...) __VA_ARGS__
SOME_MACRO(WRAP(a, b, c), d)
But I wanted something that let me just wrap the thing in parentheses without anything extra. Foolhardy, since it was a bunch of work and thought for an extremely small gain, but at least I got a fun article out of it.