First, there are a lot of posts on overloading macros:
- Can macros be overloaded by number of arguments?
- C++ Overloading Macros
- Macro overloading
- Overloading Macro on Number of Arguments
- etc. ...
However, all of them ask the question about variadic macros.
What I'd like to ask is if the following is possible:
#define FOO 3
#define FOO(a,b) a+b
int main() {
int a = FOO(0,1);
int b = FOO;
std::cout << a + b;
return 0;
}
I'd like for it to work on clang
as well.