[#BloombergLP-bslma-ManagedPtr-0fa-release-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]::release
:relfileprefix: ../../../
:mrdocs:

Release ownership, load `deleter`, and return the target pointer&period;

== Synopsis

Declared in `&lt;bslma&lowbar;managedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
TARGET&lowbar;TYPE*
release(xref:BloombergLP/bslma/ManagedPtrDeleter.adoc[ManagedPtrDeleter]* deleter);
----

== Description

Load the specified `deleter` for the currently managed object and reset this managed pointer to empty&period; Return a raw pointer to the target object (if any) managed by this pointer&period; It is undefined behavior to run the returned deleter unless the returned pointer to target object is not null&period;

== Return Value

raw pointer to the target object, or null if empty

== Parameters

[cols="1,4"]
|===
| Name| Description
| *deleter*
| out&hyphen;parameter receiving the current deleter
|===


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