[#bsl-weak_ptr-0d-operator_assign-03] = xref:bsl.adoc[bsl]::xref:bsl/weak_ptr-0d.adoc[weak_ptr]::operator= :relfileprefix: ../../ :mrdocs: Make this weak pointer refer to the same object (if any) as the specified `rhs` (shared or weak) pointer to the (template parameter) `COMPATIBLE_TYPE`. Decrement the number of weak references to the object to which this weak pointer currently manages (if any), and increment the number of weak references to the object managed by `rhs` (if any). Return a reference providing modifiable access to this weak pointer. If `COMPATIBLE_TYPE *` is not implicitly convertible to `TYPE *`, then a compiler diagnostic will be emitted. Note that if `rhs` is in the empty state, this weak pointer will be set to the empty state. == 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/weak_ptr-0d.adoc[weak_ptr<COMPATIBLE_TYPE>] const& rhs) noexcept requires is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#