 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
A
conversion function allows us to define a conversion
|
|
|
from
an object of a class to another built-in type.
|
|
|
| • |
Conversion
functions are also useful when we need to
|
|
|
|
convert
from an object of our class to an object of a class
|
|
|
that
we do not have access to or do not want to modify.
|
|
|
| • |
When
we do have access to the class and are willing to
|
|
|
|
modify
it, we can always define a constructor taking a
|
|
|
|
single
argument of our class type to perform the
|
|
|
|
conversion.
|
|
|
operator other_type();
|
|