Modify this shared pointer to manage the same modifiable object (if any) as the specified source shared pointer to the (template parameter) type ANY_TYPE, and refer to the modifiable object at the specified object address (i.e., make this shared pointer an "alias" of source). 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. Note that typically the objects referred to by source and object have identical lifetimes (e.g., 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. 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). Also note that if object is null and source is not empty, then this shared pointer will be reset to a (reference‐counted) null pointer alias. Also note that this function is logically equivalent to: ` *this = shared_ptr<ELEMENT_TYPE>(source, object); ` Further note that the behavior of this method is the same as reset(source, object).

Synopsis

Declared in <bslstl_sharedptr.h>

template<class ANY_TYPE>
void
loadAlias(
    shared_ptr<ANY_TYPE> const& source,
    ELEMENT_TYPE* object);

Description

DEPRECATED: Use reset instead.

Created with MrDocs