 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
With
constructors as conversion functions and also
|
|
|
conversion
functions, avoid mutual conversions.
|
|
|
| • |
Many
times type conversions are specified to minimize the
|
|
number
of operators overloaded, especially for symmetric
|
|
|
operators
where there can be multiple combinations of
|
|
|
types
for the two operands. It can reduce the number of
|
|
|
versions
of an operator to a single, non-member.
|
|
|
| • |
However,
this can produce subtle changes in the way a
|
|
|
program
works. If we were to add a string to char * user
|
|
|
defined
conversion function to our string class, all uses of
|
|
|
operator+
containing both char * and string types would
|
|
|
become
ambiguous.
|
|