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

Reset this `shared&lowbar;ptr` as an alias sharing ownership with `source`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ANY&lowbar;TYPE&gt;
void
loadAlias(
    xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;ANY&lowbar;TYPE&gt;] const& source,
    ELEMENT&lowbar;TYPE* object);
----

== Description

Modify this shared pointer to manage the same modifiable object (if any) as the specified `source` shared pointer to the (template parameter) type `ANY&lowbar;TYPE`, and refer to the modifiable object at the specified `object` address (i&period;e&period;, make this shared pointer an &quot;alias&quot; of `source`)&period; If this shared pointer is already managing a (possibly shared) object, then release the shared reference to that shared object, and destroy it using its associated deleter if this shared pointer held the last shared reference to that object&period; Note that typically the objects referred to by `source` and `object` have identical lifetimes (e&period;g&period;, one might be a part of the other), so that the deleter for `source` will destroy them both, but they do not necessarily have the same type&period; Also note that if `source` is empty, then this shared pointer will be reset to an empty state, even if `object` is not null (in which case this empty shared pointer will refer to the same object as `object`)&period; Also note that if `object` is null and `source` is not empty, then this shared pointer will be reset to a (reference&hyphen;counted) null pointer alias&period; Also note that this function is logically equivalent to&colon; &grave; &ast;this &equals; shared&lowbar;ptr&lt;ELEMENT&lowbar;TYPE&gt;(source, object)&semi; &grave; Further note that the behavior of this method is the same as `reset(source, object)`&period;

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *source*
| source shared pointer that supplies ownership
| *object*
| object to refer to while sharing ownership with `source`
|===


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