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

Return a `shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;` that shares ownership with an existing `shared&lowbar;ptr` object that managed this object, and throw a `std&colon;&colon;bad&lowbar;weak&lowbar;ptr` exception if there is no `shared&lowbar;ptr` currently managing this object&period; If multiple groups of `shared&lowbar;ptr`s are managing this object, the returned `shared&lowbar;ptr` will share ownership with 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/shared_ptr-0a.adoc[bsl::shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;]
shared&lowbar;from&lowbar;this();
----


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