 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Virtual
functions cannot be static member functions.
|
|
|
| • |
Second,
the signature and return type must be the same for
|
|
all
implementations of the virtual function.
|
|
|
| • |
Third, while the function must be defined
as a virtual
|
|
|
function
within a direct or indirect base class, it need not
|
|
|
be
defined in those derived classes where the inherited
|
|
|
behavior
does not need to differ.
|
|
|
| • |
And
finally, the keyword virtual is only required within
|
|
|
the
base class itself; derived class implementations of the
|
|
|
overridden
function do not need to repeat the use of that
|
|
|
keyword.
|
|
|
| • |
Once
a member function is declared to be virtual, it
|
|
|
remains
virtual for all derived classes.
|
|