9
就像在标题中一样,如何从派生类复制构造函数调用基类复制构造函数?如何从派生类复制构造函数调用基类复制构造函数?
就像在标题中一样,如何从派生类复制构造函数调用基类复制构造函数?如何从派生类复制构造函数调用基类复制构造函数?
您可以在初始化列表中指定的基础初始化:
Derived:: Derived(const Derived& other): Base(other)
{ /* ... */ }
Derived(Derived const& d)
: Base(d)
/* some member initialization */
{
/* ... */
}
我缺少的东西?
更重要的Q是你为什么要这样做? –
添加标签继承 – keelar