The assignment operator increments the reference counter of the referenced object and saves its address in the smart pointer. If the smart pointer is currently referencing to another object, that assignment operator releases the referenced object prior to the assignment.
Example of a Non-Typified Smart Pointer
Copyright © 2002–2020. Open Design Alliance. All rights reserved.
|