 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
When
using virtual inheritance, virtual functions can be
|
|
|
used
in the same way that we learned about previously.
|
|
|
| • |
However,
a class derived from two or more base classes
|
|
|
that
have a virtual base class in common must override all
|
|
|
virtual
functions declared in the common base class if it is
|
|
overridden
in more than one of its direct base class
|
|
|
branches.
|
|
|
| • |
If
virtual functions are not overridden in the derived class,
|
|
it
is impossible to know which of the virtual functions to
|
|
|
use.
It would be impossible to know which direct base
|
|
|
class'
virtual function to use! This is because the virtual
|
|
|
function
is accessed from the common base class pointer
|
|
|
pointing
to a derived class object.
|
|