[#bsl-weak_ptr-0d-operator_assign-02] = xref:bsl.adoc[bsl]::xref:bsl/weak_ptr-0d.adoc[weak_ptr]::operator= :relfileprefix: ../../ :mrdocs: 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/weak_ptr-0d.adoc[weak_ptr]& operator=(xref:bsl/shared_ptr-0a.adoc[shared_ptr<COMPATIBLE_TYPE>] const& rhs) noexcept requires is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#