 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
If we
do not want a constructor taking a single argument
|
|
|
to
also define an implicit conversion function, we can
|
|
|
prevent
that by preceding the constructor declaration with
|
|
the
keyword explicit.
|
|
|
| • |
The
application is now required to provide explicit type
|
|
|
casts
in order to convert a char* to a name object.
|
|
|
| • |
Using
a constructor as a conversion function allows us to
|
|
|
convert
an object of some other type to an object of a
|
|
|
class.
They do not allow us to define a conversion from a
|
|
|
class
to some other built-in type or class.
|
|
|
| • |
To do
so, we must define a type conversion function.
|
|