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

Create a `shared&lowbar;ptr` sharing ownership with a compatible `other`&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;
shared&lowbar;ptr(xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;COMPATIBLE&lowbar;TYPE&gt;] const& other) noexcept;
----

== Description

Create a shared pointer that manages the same modifiable object (if any) as the specified `other` shared pointer to the (template parameter) type `COMPATIBLE&lowbar;TYPE`, uses the same deleter as `other` to destroy the shared object, and refers to `(ELEMENT&lowbar;TYPE&ast;)other&period;get()`&period; If `COMPATIBLE&lowbar;TYPE &ast;` is not implicitly convertible to `ELEMENT&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted indicating the error&period; Note that if `other` is empty, then an empty shared pointer is created, which may still point to an un&hyphen;managed object if `other` were constructed through an aliasing constructor&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| other pointer to compare or share ownership with
|===


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