smart_ptr::operator= Method

Assigns another smart_ptr to this.
Syntax:
smart_ptr& operator=( smart_ptr op2 );
Parameter Description
op2

The smart_ptr to be assigned to this.

Return value:

A reference to this.

Remarks:

If the target of the assignment pointed to an object before the operation, the reference counter for that object will be decreased and the object will be deleted, if this instance of smart_ptr held the last reference.

The reference count of the object pointed to by the assigned smart_ptr is increased by one.

See also: smart_ptr

<< smart_ptr