 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
The
next set of operators we will examine are the relational
|
|
|
and
equality operators
|
|
|
| • |
These
should be overloaded as non-members as either the
|
|
|
first
or second operands could be a non-class object: string
|
|
|
<
literal, literal < string, string < string
|
|
|
| • |
Neither
operand is modified, so all class objects should be
|
|
|
passed
as constant references.
|
|
|
| • |
The
residual value should be a bool, however an int will
|
|
|
also
suffice, returned by value.
|
|
|
| • |
If
overloaded as a member -- make
sure to specify them as a const
|
|
member,
for the same reasons as discussed earlier.
|
|