The solution to the diamond problem is to use the virtual keyword . We make the two parent classes (who inherit from the same grandparent class) into virtual classes in order to avoid two copies of the grandparent class in the child class.
The solution to the diamond problem is to use the virtual keyword . We make the two parent classes (who inherit from the same grandparent class) into virtual classes in order to avoid two copies of the grandparent class in the child class.