[#bsl-enable_shared_from_this-weak_from_this-0f]
= xref:bsl.adoc[bsl]::xref:bsl/enable_shared_from_this.adoc[enable&lowbar;shared&lowbar;from&lowbar;this]::weak&lowbar;from&lowbar;this
:relfileprefix: ../../
:mrdocs:

Return a `weak&lowbar;ptr` holding a weak reference (with only `const` access) to this managed object if this object is currently managed by `shared&lowbar;ptr`, and return an expired `weak&lowbar;ptr` otherwise&period; If multiple groups of `shared&lowbar;ptr`s are managing this object, the returned `weak&lowbar;ptr` will hold a weak reference to the group that first managed this object&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;sharedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/weak_ptr-0d.adoc[bsl::weak&lowbar;ptr&lt;ELEMENT&lowbar;TYPE const&gt;]
weak&lowbar;from&lowbar;this() const noexcept;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
