The virtual inheritance in C++ is an useful way to prevent the diamond issue. However, I can't seem to make it work properly in each and every case.
This is going to be very hard to explain but I hope I'll manage. Let's present the problem:
A inherits B. And A is the base class of a class set called C and another class set called D.
The problem is that the C set of class have common features focusing around B.
What I would like to do, but isn't possible, is a class E that virtually inherits B, and which is inherited by C. Problem is:
In this case, A doesn't virtually inherits B. So it doesn't work.
If A was to virtually inherit B, then I would need to use B's constructor in every classes of D.
Conclusion: in every case there is duplicated code. How may I get out of this issue without any duplicated code ?