[#bsl-shared_ptr-0a-2constructor-0a] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::shared_ptr :relfileprefix: ../../ :mrdocs: Create a shared pointer that reference‐counts the null pointer, calls the specified `deleter` with a null pointer (i.e., invokes `deleter((ELEMENT_TYPE *)0)`) when the last shared reference is destroyed, and uses the specified `basicAllocator` to allocate and deallocate the internal representation of the shared pointer (including a copy of the `deleter`). The (template parameter) type `DELETER` shall be either a function pointer or a function‐like deleter (See the "Deleters" section in the component‐ level documentation). The (template parameter) type `ALLOCATOR` shall satisfy the Allocator requirements of the C++ standard (C++11 17.6.3.5, [allocator.requirements]). The specified `nullPointerLiteral` is not used. If an exception is thrown when allocating storage for the internal representation, then `deleter((ELEMENT_TYPE *)0)` will be called. The behavior is undefined unless `deleter` can be called with a null pointer, and unless the constructor making a copy of `deleter` does not throw an exception. Note that the final dummy parameter is a simple SFINAE check that the `ALLOCATOR` type probably satisfies the standard allocator requirements; in particular, it will not match pointer types, so any pointers to `bslma::Allocator` derived classes will dispatch to the constructor above this, and not be greedily matched to a generic type parameter. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class DELETER, class ALLOCATOR> shared_ptr( xref:bsl/nullptr_t-08.adoc[nullptr_t] nullPointerLiteral, DELETER deleter, ALLOCATOR basicAllocator, ALLOCATOR::value_type* = 0); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#