Modify this shared pointer to manage the modifiable object of the (template parameter) type COMPATIBLE_TYPE at the specified ptr address, refer to (ELEMENT_TYPE *)ptr and use the specified deleter to delete the shared object when all references have been released. Use the specified basicAllocator to allocate and deallocate the internal representation of the shared pointer. If basicAllocator is 0, the currently installed default allocator is used. If this shared pointer is already managing a (possibly shared) object, then, unless an exception is thrown creating storage to manage ptr, 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. If DELETER is a reference type, then deleter is assumed to be a function-like deleter that may be invoked to destroy the object referred to by a single argument of type COMPATIBLE_TYPE * (i.e., deleter(ptr) will be called to destroy the shared object). If DELETER is a pointer type, then deleter is assumed to be a pointer to a factory object that exposes a member function that can be invoked as deleteObject(ptr) that will be called to destroy the object at the ptr address (i.e., deleter->deleteObject(ptr) will be called to delete the shared object). (See the "Deleters" section in the component-level documentation.) If an exception is thrown allocating the internal representation, then deleter(ptr) is called (or deleter->deleteObject(ptr) for factory-type deleters) and this shared pointer retains ownership of its original object. The behavior is undefined unless deleter(ptr) is a well-defined expression (or deleter->deleteObject(ptr) for factory-type deleters), and unless the copy constructor for deleter does not throw an exception. If COMPATIBLE_TYPE * is not implicitly convertible to ELEMENT_TYPE *, then a compiler diagnostic will be emitted indicating the error. Note that, for factory deleters, the deleter must remain valid until all references to ptr have been released. Also note that if ptr is 0, then an internal representation will still be allocated, and this shared pointer will share ownership of a copy of deleter. Further note that this function is logically equivalent to: ` *this = shared_ptr<ELEMENT_TYPE>(ptr, deleter, basicAllocator); `
Declared in <bslstl_sharedptr.h>
template<
class COMPATIBLE_TYPE,
class DELETER>
void
load(
COMPATIBLE_TYPE* ptr,
DELETER const& deleter,
BloombergLP::bslma::Allocator* basicAllocator);
DEPRECATED: Use reset instead.