Consider the following:
struct S {
void f() {}
};
#define f 42
int main() {
S s;
s.f(); // error: expected unqualified-id
}
How to call a member function S::f
without undefining the macro f
or changing member function name? Is it even possible?
If the macro was defined as #define f() 42
(with parentheses), I could fix the issue like (s,f)()
. But there are no parentheses in macro definition.