Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何编写具有多重继承的复制构造函数?
B1并且B2被D继承链中没有钻石继承。我需要编写一个复制构造函数,D以便它调用B1和的复制构造函数B2
B1
B2
D
我想避免在clone()这里写
clone()
经典方法有什么问题:
D(const D& other) : B1(other), B2(other) { }
?