To clarify, I'm trying to create a macro which makes taking member function addresses a little easier, so I would hope to input a member function name of the current class (and only the member function name), and the macro will use the type of the variable or the type of the enclosing class to actually access the function. e.g.
#define GETMEMBERFUNCTIONPOINTER(identifier) /*magic code goes here*/
struct myStruct {
void (myStruct::*functionPointer)();
void myMemberFunc() {
}
myStruct() {
functionPointer = GETMEMBERFUNCTIONPOINTER(myMemberFunc);
}
};
is this possible? The closest I've managed is to have each class inherit a private typedef which can be used in the macro