[#bsl-shared_ptr-0a-2constructor-0c] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::shared_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. The number of references to `rep` is _NOT_ incremented. Note that if `rep` is a pointer to a class derived from `BloombergLP::bslma::SharedPtrRep`, the compiler will actually select the following (more general) constructor that has the same behavior: ` template <class COMPATIBLE_TYPE, class DELETER> shared_ptr(COMPATIBLE_TYPE *ptr, DELETER * deleter); ` == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- shared_ptr( xref:bsl/shared_ptr-0a/element_type.adoc[element_type]* ptr, xref:BloombergLP/bslma/SharedPtrRep.adoc[BloombergLP::bslma::SharedPtrRep]* rep); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#