Below is the class hierarchy I have.
All Ixxxx
classes are interfaces (abstract classes with no member data).
All arrows represent inheritance.
Colors are only here to provide better visualisation.
Somewhere in the code using these classes, I have to pass a Track*
where an IConnectableTrack*
is expected, and I get the following compilation error:
error: ‘IConnectableTrack’ is an ambiguous base of ‘Track’
I know this is a matter of multiple inheritance, but I tried multiple combinations of virtual
inheritances to no avail.
In particular, I thought virtualizing both inheritances between red interfaces and both inheritances between green classes (i.e. all purple arrows) would be enough, but it does not solve the problem.
What would be the correct construct here?
Edit: this question is different from the mentionned one since it includes pure abstract classes, which relates to the specific error message referenced.