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

Return a `ManagedPtr` referring to the same object as this `shared&lowbar;ptr`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[BloombergLP::bslma::ManagedPtr&lt;ELEMENT&lowbar;TYPE&gt;]
managedPtr() const;
----

== Description

Return a managed pointer that refers to the same object as this shared pointer&period; If this shared pointer is not empty, and is not null, then increment the shared count on the shared object, and give the managed pointer a deleter that decrements the reference count for the shared object&period; Note that if this `shared&lowbar;ptr` is reference&hyphen; counting a null pointer, the empty `bslma&colon;&colon;ManagedPtr` returned will not participate in that shared ownership&period;

== Return Value

managed pointer referring to the same object


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