Hi.
for example i have base class A and dirved class B:
struct A
{
virtual void f() { std::cout << "A::f()" << std::endl; }
};
struct B : public A
{
void f() { std::cout << "B::f()" << std::endl; }
};
int main()
{
B b;
A *a = &b;
a->f(); // virtual call. calls B::f()
a->A::f(); // non-virtual call. calls A::f()
A::* pf;
pf = &A::f();
(a->*pf)(); // virtual call. calls B::f()
pf = /* ??? */; // what should i write here for desired effect(non-
virtual call)
(a->*pf)(); // non-virtual call. calls A::f()
return 0;
}
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]