I hope I understand the problem correctly.
The anatomy of a pointer to a (virtual) member function in Base looks like this:
Code:
return_type (Base::*)(param_type);
If you want to store a pointer to a member function, and call it later on, you must invoke it on an object:
Code:
class Base
{
public:
virtual void Foo () { cout << "Foo in Base" << endl; }
};
class Derived : public Base
{
public:
virtual void Foo () { cout << "Foo in Derived" << endl; }
};
int main ()
{
typedef void(Base::*FunctionPtr)();
FunctionPtr foo_function = &Base::Foo;
Base Obj1;
Derived Obj2;
(Obj1.*(foo_function))();
(Obj2.*(foo_function))();
return 0;
}