When employing multiple inheritance, virtual base classes are used to prevent several "instances" of a particular class from appearing in an inheritance hierarchy.
Consider the following example:
class A { public: void Foo() {} };
class B : public A {};
class C : public A {};
class D : public B, public C {};
The preceding class hierarchy yields the "dreaded diamond," which looks like this:
A
/ \
B C
\ /
D
A D instance will consist of B, which contains A, and C, which also includes A.
So you have two "instances" of A (for lack of a better term).
There is the possibility of ambiguity in this circumstance.
This is what happens when you do this:
D d;
d.Foo(); // is this B's Foo() or C's Foo() ??
Virtual inheritance exists to address this issue.
While you use the virtual keyword when inheriting a class, you're informing the compiler that you only want one instance.
class A { public: void Foo() {} };
class B : public virtual A {};
class C : public virtual A {};
class D : public B, public C {};
This signifies that the hierarchy has just one "instance" of A.
Hence
D d;
d.Foo(); // no longer ambiguous