[#bsl-shared_ptr-0a-operator_assign-09c] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::operator= :relfileprefix: ../../ :mrdocs: Make this shared pointer refer to and manage the same modifiable object as the specified `rhs` shared pointer to the (template parameter) type `COMPATIBLE_TYPE`, using the same deleter as `rhs` and referring to `(ELEMENT_TYPE *)rhs.get()`, and return a reference to this modifiable shared pointer. If this shared pointer is already managing a (possibly shared) object, then release the shared reference to that object, and destroy it using its associated deleter if this shared pointer held the last shared reference to that object. Reset `rhs` to an empty state, not pointing to any object, unless `*this` is the same object as `rhs`. This function does not exist unless a pointer to (template parameter) `COMPATIBLE_TYPE` is convertible to a pointer to the (template parameter) `ELEMENT_TYPE` of this `shared_ptr`. Note that if `rhs` is empty, then this shared pointer will also be empty after the assignment. Move‐assign from the specified compatible `shared_ptr` `rhs`. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class COMPATIBLE_TYPE> xref:bsl/shared_ptr-0a.adoc[shared_ptr]& operator=(xref:bsl/shared_ptr-0a.adoc[shared_ptr<COMPATIBLE_TYPE>]&& rhs) noexcept requires is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#