I would like to write a preprocessor macro that does one thing if it's argument is a parenthesized tuple of tokens, like this:
MY_MACRO((x, y))
and something else if it's just a single token, like this:
MY_MACRO(x)
Is that possible?
How about distinguishing between the number of space-separated tokens, i.e. between MY_MACRO(x)
and MY_MACRO(x y)
?
Note that I am not trying to overload based on the number of arguments - it's a unary macro in all cases.
EDIT: I am willing to use variadic macros if they help