[#BloombergLP-bslma-ManagedPtr-0fa-loadAlias] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]::loadAlias :relfileprefix: ../../../ :mrdocs: If the specified `alias` manages the same object as this managed pointer, set the target object of this managed pointer to be that referenced by the specified `ptr`; otherwise, destroy the currently managed object (if any), and if `alias` is empty, reset this managed pointer to empty; otherwise, transfer ownership (and the deleter) of the object managed by `alias`, and set the target object of this managed pointer to be that referenced by `ptr`. The behavior is undefined if `0 == ptr` and `alias` is not empty, or if `0 != ptr` and `alias` is empty, or if `ptr` is already managed by a managed pointer other than `alias`. Note that this establishes a managed pointer where `ptr` aliases `alias`. The managed object for `alias` will ultimately be destroyed, and the destructor for `ptr` is not called directly. == Synopsis Declared in `<bslma_managedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALIASED_TYPE> void loadAlias( xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr<ALIASED_TYPE>]& alias, TARGET_TYPE* ptr); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#