Using typedef, it just makes syntax easy.
In the following example, a function is defined outside of your class.
class A{
typedef void (A::*p)();
void f(){};
p get_f();
};
A::p A::get_f() { return &A::f; }
You can define it inside a class in the same way
class A{
typedef void (A::*p)();
void f(){};
p get_f() { return &A::f; }
};
source
share