chsvlib
chsv helper source code

◆ operator=()

MyType& operator= ( MyType &&  rrRight)

A move assignment operator for the C_auto_ptr classes. The standard copy assignment operator is disallowed for the class (see std::unique_ptr::operator=).

Parameters
rrRightis an rvalue reference to the C_auto_ptr instance of the same template instantiation. The contents of the parameter object is moved into the constructed one.
Remarks
After the construction the created object holds ownership of the pointer and delete of the moved instance of the C_auto_ptr instantiation.
After the construction rrRight looses ownership of the pointer it stored and of its deleter and is left empty. The behaviour of the constructor can be shortly described by the following code:
this->reset(rrRight.release());
this->get_deleter() = rrRight.get_deleter();