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

Reset this `shared&lowbar;ptr` from the specified arguments&period;

== Synopsis

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

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

== Description

Modify this shared pointer to manage the modifiable object of the (template parameter) type `COMPATIBLE&lowbar;TYPE` at the specified `ptr` address and to refer to `(ELEMENT&lowbar;TYPE &ast;)ptr`&period; If this shared pointer is already managing a (possibly shared) object, then, unless an exception is thrown allocating memory to manage `ptr`, release the reference to the shared object, calling the associated deleter to destroy the shared object if this shared pointer is the last reference&period; Use the specified `basicAllocator` to allocate the internal representation of this shared pointer and to destroy the shared object when all references have been released&semi; if `basicAllocator` is 0, the currently installed default allocator is used&period; If an exception is thrown allocating the internal representation, then destroy `&ast;ptr` with a call to `alloc&hyphen;&gt;deleteObject(ptr)` where `alloc` is the chosen allocator, and this shared pointer retains ownership of its original object&period; If `COMPATIBLE&lowbar;TYPE &ast;` is not implicitly convertible to `ELEMENT&lowbar;TYPE &ast;`, then a compiler diagnostic will be emitted indicating the error&period; Note that if `ptr` is 0, then this shared pointer will still allocate an internal representation to share ownership of that empty state, which will be reclaimed when the last reference is destroyed&period; Also note that this function is logically equivalent to&colon; &grave; &ast;this &equals; shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;(ptr, basicAllocator)&semi; &grave;

DEPRECATED&colon; Use `reset` instead&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ptr*
| pointer to the object to manage or refer to
| *basicAllocator*
| allocator used to supply memory
|===


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