可以提供实现
class A{
virtual void f()const{cout<<"A:f()"<<endl;}
}
class B:public A{
void f()const{A::f();cout<<"B:f()"<<endl;}
}
main()
{
B b;
b.f();//应该输出A:f() B:f()
}
class A{
virtual void f()const{cout<<"A:f()"<<endl;}
}
class B:public A{
void f()const{A::f();cout<<"B:f()"<<endl;}
}
main()
{
B b;
b.f();//应该输出A:f() B:f()
}