I have diamond hierarchy of classes:
A / \\ B C \\ / D
To avoid two copies of A in D, we need to use virtual inheritance a
In addition to templatetypedef answer, it may be pointed out that you also may wrap A into
class AVirt:virtual public A{};
and inherit other classes from it. You wil not need to mark explicitly other inheriances as virtual in this case