请有人解释波伏瓦吗?它使用Base的默认参数调用Derived&#39的函数?它的打印10 Derived's f():
#include <iostream>
class Base
{
public:
virtual void f(int x=10)
{
std::cout<<x<<" Base f()"<<std::endl;
}
};
class Derived : public Base
{
public:
virtual void f(int x=20)
{
std::cout<<x<<" Derived f()"<<std::endl;
}
};
int main()
{
Base* bp = new Derived();
bp->f();
}