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

Destroy the currently managed object, if any&period; Then, set the target object of this managed pointer to be that referenced by the specified `ptr`, take ownership of `&ast;ptr` as the currently managed object, and set a deleter that will invoke the specified `deleter` with the address of the currently managed object, and with the specified `cookie` (that the deleter can use for its own purposes), unless `0 &equals;&equals; ptr`, in which case reset this managed pointer to empty&period; The behavior is undefined if `ptr` is already managed by another object, or if `0 &equals;&equals; deleter &amp;&amp; 0 !&equals; ptr`&period; Note that this function is _deprecated_ as it relies on undefined compiler behavior for its implementation, but luckily perform as required for all currently supported platforms&semi; on platforms where the non&hyphen;deprecated overload is not available (e&period;g&period;, GCC 3&period;4) code should be written as if it were available, as an appropriate (deprecated) overload will be selected with the correct (non&hyphen;deprecated) behavior&period;

== Synopsis

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

[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
load(
    MANAGED&lowbar;TYPE* ptr,
    COOKIE&lowbar;TYPE* cookie,
    void(* deleter)(MANAGED&lowbar;BASE*, COOKIE&lowbar;BASE*));
----

== Description

DEPRECATED&colon; Instead, use&colon; &grave; template &lt;class MANAGED&lowbar;TYPE&gt; void load(MANAGED&lowbar;TYPE &ast;ptr, void &ast;cookie, DeleterFunc deleter)&semi; &grave;


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