[#bsl-shared_ptr-0a-2constructor-0735] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::shared_ptr :relfileprefix: ../../ :mrdocs: Create a shared pointer that takes over the management of the modifiable object previously managed by the specified `adoptee` to the (template parameter) type `COMPATIBLE_TYPE`, and that refers to `(ELEMENT_TYPE *)autoPtr.get()`. `delete(autoPtr.release())` will be called 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. This function does not exist unless `unique_ptr<COMPATIBLE_TYPE, DELETER>::pointer` is convertible to `ELEMENT_TYPE *`. Note that this function creates a `shared_ptr` with an unspecified deleter type that has satisfies this contract, which might not be the deleter of `rhs`, which is specified by the C++ standard. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class COMPATIBLE_TYPE, class UNIQUE_DELETER> requires is_convertible< typename std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>::pointer, ELEMENT_TYPE *>::value shared_ptr( std::unique_ptr<COMPATIBLE_TYPE, UNIQUE_DELETER>&& adoptee, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator = 0); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#