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

`load` overloads

== Synopses

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

Take ownership of `&ast;ptr` using the default allocator as deleter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class MANAGED&lowbar;TYPE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-0e.adoc[load](MANAGED&lowbar;TYPE* ptr);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-0e.adoc[_» more&period;&period;&period;_]#

Take ownership of `&ast;ptr` destroyed via `factory`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class MANAGED&lowbar;TYPE,
    class FACTORY&lowbar;TYPE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-03.adoc[load](
    MANAGED&lowbar;TYPE* ptr,
    FACTORY&lowbar;TYPE* factory);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-03.adoc[_» more&period;&period;&period;_]#

Reset this managed pointer to empty&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-09.adoc[load](
    xref:bsl/nullptr_t-08.adoc[bsl::nullptr&lowbar;t] nullPointerLiteral = 0,
    void* cookie = 0,
    xref:BloombergLP/bslma/ManagedPtr-0fa/DeleterFunc.adoc[DeleterFunc] deleter = 0);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-09.adoc[_» more&period;&period;&period;_]#

Take ownership of `&ast;ptr` with the specified deleter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class MANAGED&lowbar;TYPE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-0d8.adoc[load](
    MANAGED&lowbar;TYPE* ptr,
    void* cookie,
    xref:BloombergLP/bslma/ManagedPtr-0fa/DeleterFunc.adoc[DeleterFunc] deleter);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-0d8.adoc[_» more&period;&period;&period;_]#

Take ownership of `&ast;ptr` with the specified deleter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class MANAGED&lowbar;TYPE,
    class COOKIE&lowbar;TYPE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-0dd.adoc[load](
    MANAGED&lowbar;TYPE* ptr,
    COOKIE&lowbar;TYPE* cookie,
    xref:BloombergLP/bslma/ManagedPtr-0fa/DeleterFunc.adoc[DeleterFunc] deleter);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-0dd.adoc[_» more&period;&period;&period;_]#

Take ownership of `&ast;ptr` with the specified deleter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class MANAGED&lowbar;TYPE,
    class MANAGED&lowbar;BASE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-0a.adoc[load](
    MANAGED&lowbar;TYPE* ptr,
    void* cookie,
    void(* deleter)(MANAGED&lowbar;BASE*, void*));
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-0a.adoc[_» more&period;&period;&period;_]#

Take ownership of `&ast;ptr` with the specified deleter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class MANAGED&lowbar;TYPE,
    class MANAGED&lowbar;BASE,
    class COOKIE&lowbar;TYPE,
    class COOKIE&lowbar;BASE&gt;
void
xref:BloombergLP/bslma/ManagedPtr-0fa/load-06.adoc[load](
    MANAGED&lowbar;TYPE* ptr,
    COOKIE&lowbar;TYPE* cookie,
    void(* deleter)(MANAGED&lowbar;BASE*, COOKIE&lowbar;BASE*));
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/load-06.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ptr*
| pointer to the object to manage, or null
| *factory*
| factory used to destroy the managed object
| *nullPointerLiteral*
| null&hyphen;pointer literal (unused&semi; selects this overload)
| *cookie*
| unused cookie pointer
| *deleter*
| unused deleter function
|===


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