多重继承,复制构造函数和基类初始化?

Dip*_*Sen 2 c++ constructor multiple-inheritance copy-constructor

如何编写具有多重继承的复制构造函数?

B1并且B2是继承了D存在继承链中没有金刚钻.我需要编写一个复制构造函数,D以便它调用B1和的复制构造函数B2

我想避免在clone()这里写一篇文章

Luc*_*ore 5

经典方法有什么问题:

D(const D& other) : B1(other), B2(other)
{
}
Run Code Online (Sandbox Code Playgroud)