I have the following program which I’d like to get it fixed. Not sure how to make it syntactically correct.
class A{
void f(){};
void (A::*)()get_f(){return &A::f;}
};
Also, I would like eventually move the function definition outline like the following.
void A::(*)()A::get_f(){
return &A::f;
}
What the correct syntax here too?
Thanks a lot for your help!
Like this:
and similarly:
See it in action on ideone. Note that using it is just the same as with typedef (in the other answers).
BTW, for extra points and vomit (ha, ha):