In C++, what is a virtual base class?

Virtual base classes, used in virtual inheritance, is a way of preventing multiple “instances” of a given class appearing in an inheritance hierarchy when using multiple inheritance. Consider the following scenario: The above class hierarchy results in the “dreaded diamond” which looks like this: An instance of D will be made up of B, which … Read more