 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Remember,
the lifetime of a temporary object is from the
|
|
|
|
time
it is created until the end of the statement in which it
|
|
|
was
created.
|
|
|
| • |
In
the assignment statement, the temporary object is
|
|
|
|
destroyed
after the temporary is assigned.
|
|
|
| • |
As a
formal argument (passed by value), the temporary
|
|
|
|
object
is destroyed after the function is called.
|
|
|
| • |
Therefore,
not only are temporary objects formed (and the
|
|
|
constructor
implicitly invoked) but the objects are also
|
|
|
|
destroyed
(and the destructors are implicitly invoked).
|
|