Destroy the currently managed object, if any. Then, set the target object of this managed pointer to be that referenced by the specified ptr, take ownership of *ptr as the currently managed object, and set a deleter that uses the currently installed default allocator to destroy the managed object when invoked (e.g., when this managed pointer object is destroyed), unless 0 == ptr, in which case reset this managed pointer to empty. The deleter will invoke the destructor of MANAGED_TYPE rather than the destructor of TARGET_TYPE. This function will not compile unless MANAGED_TYPE * is convertible to TARGET_TYPE *. The behavior is undefined unless the managed object (if any) can be destroyed by the currently installed default allocator, or if the lifetime of the managed object is already managed by another object.
Synopsis
Declared in <bslma_managedptr.h>
template<class MANAGED_TYPE>
void
load(MANAGED_TYPE* ptr);
Created with MrDocs