What is the proper approach to swap and copy idiom in virtual inheritance?
问题 Consider classic virtual inheritance diamond hierarchy. I wonder to know what is the right implementation of copy and swap idiom in such hierarchy. The example is a little artificial - and it is not very smart - as it would play good with default copy semantic for A,B,D classes. But just to illustrate the problem - please forget about the example weaknesses and provide the solution. So I have class D derived from 2 base classes (B<1>,B<2>) - each of B classes inherits virtually from A class.