[#bsl-shared_ptr-0a-2constructor-08d]
= xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]::shared&lowbar;ptr
:relfileprefix: ../../
:mrdocs:

Create a shared pointer that refers to and manages the same object as the specified `ptr` if `ptr&period;expired()` is `false`&semi; otherwise, create a shared pointer in the empty state&period; Note that the referenced and managed objects may be different if `ptr` was created from a `shared&lowbar;ptr` in an aliasing state&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class COMPATIBLE&lowbar;TYPE&gt;
explicit
shared&lowbar;ptr(xref:bsl/weak_ptr-0d.adoc[weak&lowbar;ptr&lt;COMPATIBLE&lowbar;TYPE&gt;] const& ptr);
----


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