Create a shared pointer that takes over the management of the modifiable object (if any) previously managed by the specified managedPtr to the (template parameter) type CONVERTIBLE_TYPE, and that refers to (ELEMENT_TYPE *)managedPtr.ptr(). The deleter used in the managedPtr will be used to destroy the shared object when all references have been released. Optionally specify a basicAllocator used to allocate and deallocate the internal representation of the shared pointer. If basicAllocator is 0, the currently installed default allocator is used. If CONVERTIBLE_TYPE * is not implicitly convertible to ELEMENT_TYPE *, then a compiler diagnostic will be emitted indicating the error. Note that if managedPtr is empty, then an empty shared pointer is created and basicAllocator is ignored. Also note that if managedPtr owns a reference to another shared object (due to a previous call to shared_ptr<T>::managedPtr) then no memory will be allocated, and this shared_ptr will adopt the `ManagedPtr`s ownership of that shared object.
Synopsis
Declared in <bslstl_sharedptr.h>
template<class CONVERTIBLE_TYPE>
shared_ptr(
BloombergLP::bslma::ManagedPtr<CONVERTIBLE_TYPE> managedPtr,
BloombergLP::bslma::Allocator* basicAllocator = 0);
Created with MrDocs