class Base {
public:
int a;
Base():a(0) {}
virtual ~Base();
}
class Derived : public Base {
public:
int b;
Derived():b(0) {
Base* pBase = static_cast<Base*>(this);
pBase->Base();
}
~Derived();
}
对基类构造函数的调用是必要的还是 c++ 会自动执行此操作?例如,C++ 是否要求您从任何派生类初始化基类成员?