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

Create a shared pointer that takes ownership of the specified `rep` and refers to the modifiable object at the specified `ptr` address&period; The number of references to `rep` is _NOT_ incremented&period; Note that if `rep` is a pointer to a class derived from `BloombergLP&colon;&colon;bslma&colon;&colon;SharedPtrRep`, the compiler will actually select the following (more general) constructor that has the same behavior&colon; &grave; template &lt;class COMPATIBLE&lowbar;TYPE, class DELETER&gt; shared&lowbar;ptr(COMPATIBLE&lowbar;TYPE &ast;ptr, DELETER &ast; deleter)&semi; &grave;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
shared&lowbar;ptr(
    xref:bsl/shared_ptr-0a/element_type.adoc[element&lowbar;type]* ptr,
    xref:BloombergLP/bslma/SharedPtrRep.adoc[BloombergLP::bslma::SharedPtrRep]* rep);
----


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