[#bsl-shared_ptr-0a-operator_assign-02] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::operator= :relfileprefix: ../../ :mrdocs: Transfer, to this shared pointer, ownership of the modifiable object managed by the specified `rhs` auto pointer to the (template parameter) type `COMPATIBLE_TYPE`, and make this shared pointer refer to `(ELEMENT_TYPE *)rhs.get()`. `delete(autoPtr.release())` will be called to destroy the shared object when all references have been released. If this shared pointer is already managing a (possibly shared) object, then release the reference to that shared object, and destroy it using its associated deleter if this shared pointer held the last shared reference to that object. Note that if `rhs` is empty, then this shared pointer will be empty after the assignment. == 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=(std::auto_ptr<COMPATIBLE_TYPE> rhs) requires is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#