bsl::shared_ptr::operator=

Move-assign from a compatible shared_ptr rhs.

Synopsis

Declared in <bslstl_sharedptr.h>

shared_ptr&
operator=(BloombergLP::bslmf::MovableRef<shared_ptr> rhs) noexcept;

Description

Make this shared pointer manage the same modifiable object as the specified rhs shared pointer to the (template parameter) type COMPATIBLE_TYPE, use the same deleter as rhs, and refer to rhs.get(); return a reference providing modifiable access to this shared pointer. Reset rhs to an empty state, not pointing to any object, unless *this is the same object as rhs. Note that if rhs is empty, then this shared pointer will also be empty after the assignment.

Return Value

reference providing modifiable access to this shared pointer

Parameters

NameDescription
rhsright-hand side operand