[#bsl-enable_shared_from_this-weak_from_this-05] = xref:bsl.adoc[bsl]::xref:bsl/enable_shared_from_this.adoc[enable_shared_from_this]::weak_from_this :relfileprefix: ../../ :mrdocs: Return a `weak_ptr` holding a weak reference to this managed object if this object is currently managed by `shared_ptr`, and return an expired `weak_ptr` otherwise. If multiple groups of `shared_ptr`s are managing this object, the returned `weak_ptr` will hold a weak reference to the group that first managed this object. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/weak_ptr-0d.adoc[bsl::weak_ptr<ELEMENT_TYPE>] weak_from_this() noexcept; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#