【发布时间】:2011-03-05 17:59:29
【问题描述】:
class Base {
public:
Base() {}
void Foo(int x) {...}
};
class Derived : public Base {
public:
Derived(int args) {
/* process args in some way */
Foo(result);
}
};
是否允许在派生类的构造函数中调用基类的方法? 我想这很好,因为 Base 对象应该完全构造,但我想检查一下以防万一。
【问题讨论】:
标签: c++ constructor methods base