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.
Declared in <bslma_managedptr.h>
template<class ALIASED_TYPE>
void
loadAlias(
ManagedPtr<ALIASED_TYPE>& alias,
TARGET_TYPE* ptr);