[#BloombergLP-bslma-ManagedPtr-0fa-load-0d8] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]::load :relfileprefix: ../../../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class MANAGED_TYPE> void load( MANAGED_TYPE* ptr, void* cookie, xref:BloombergLP/bslma/ManagedPtr-0fa/DeleterFunc.adoc[DeleterFunc] deleter); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#