I want to write
struct Foo{
MY_MACRO
};
and have that expand into
struct Foo{
void bar(Foo&){}
};
How do I define MY_MACRO?
The only things I can come up with is the following:
#define MY_MARCO(X) void bar(X&){}
struct Foo{
MY_MACRO(Foo)
};
This comes very close but is sub ideal, as I do not want to repeat the class name.
Unfortunately the following does not compile:
struct Foo{
void bar(decltype(*this)&){}
};