chsvlib
chsv helper source code

◆ operator=()

MyType& operator= ( MyType &&  rrRight)

An assignment operator.

Parameters
rrRightis an rvalue reference to an instance of the AutoResource to be moved to the instance being currently constructed.
Returns
The operator returns a reference to the object receiving new assets.
Remarks
The object acquires the ownership of content rrRight, including the stored handle, closer and checker (along with the responsibility of closing the object at some point). Any object owned by the AutoResource object before the call is closed (as if AutoResource destructor was called).
If the argument owns a value-initialized handle the object would own nothing with the same behaviour as if calling
this->reset();
Otherwise, it acquires assets of the rrRight, with a behaviour equivalent to
this->reset(rrRight.release());
this->get_closer() = std::move<closer_type>(rrRight.get_closer());
this->IsHandleValid = std::move<checker_type>(rrRight.IsHandleValid);
Standard copy assignment is not allowed for AutoResource objects.