operator->* is for pointers to members.
struct foo{ void bar(){} }; int main(){ typedef void (foo:*foo_memptr)(); foo_memptr pfunc = &foo::bar; foo f; foo* pf = &f; (f.*pfunc)();
Overloading is usually only useful for smart pointers, and even they do not, because it is really complicated, and the same functions can be achieved using ((*pf).*pfunc)() . Scott Meyers even wrote a PDF on how to do it !
source share