 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
We
will talk about this again once we discuss operator
|
|
|
overloading.
|
|
|
| • |
But,
for those of you already familiar with operator
|
|
|
overloading,
keep in mind you need to careful within a
|
|
|
hierarchy.
|
|
|
| • |
For
the assignment operator, this is not as simple. We must
|
|
|
invoke
the base class' assignment operator from within the
|
|
|
body
of our derived class' assignment op.
|
|
|
| • |
To
do so requires that we cast the current object (accessible
|
|
by
*this) into a base class object as follows:
|
|
|
student &student::operator=(const student &s) {
|
|
|
static_cast<checking
&>(*this) = s;
|
|