In following code:
class foo { public: void foo_function() {}; }; class bar { public: foo foo_member; void bar_function(foo bar::*p_foo) { // what is the corrct sintax for following: this->*p_foo->foo_function(); // expression must have a pointer type?? } }; int main() { foo foo_obj; bar bar_obj; typedef foo bar::*p_foo; p_foo blah = &bar::foo_member; bar_obj.bar_function(blah); return 0; } What would be correct syntax to make bar::bar_function work?
((this->*p_foo).foo_function)();p_foo blah = &bar::foo_member;In which way do you think that&bar::foo_memberprovides a member function pointer actually?void bar_function(foo bar::*p_foo)wants a member function pointer. So how can you say we're not talking about member function pointers??foois a class, not a function pointer typedef.