BloombergLP::bslma::ManagedPtr::load

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 will invoke the specified deleter with the address of the currently managed object, and with the specified cookie (that the deleter can use for its own purposes), unless 0 == ptr, in which case reset this managed pointer to empty. The behavior is undefined if ptr is already managed by another object, or if 0 == deleter && 0 != ptr. Note that GCC 3.4 and earlier versions have a bug in template type deduction/overload resolution that causes ambiguities if this signature is available. This function will be restored on that platform once the deprecated signatures are finally removed.

Synopsis

Declared in <bslma_managedptr.h>

template<class MANAGED_TYPE>
void
load(
    MANAGED_TYPE* ptr,
    void* cookie,
    DeleterFunc deleter);