bsl::shared_ptr::shared_ptr

Create a shared pointer that reference-counts the null pointer, and calls the specified deleter with a null pointer (i.e., invokes deleter((ELEMENT_TYPE *)0)) when the last shared reference is destroyed. The specified nullPointerLiteral is not used. Optionally specify a basicAllocator to allocate and deallocate the internal representation of the shared pointer (including a copy of deleter). If basicAllocator is 0, the currently installed default allocator is 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.

Synopsis

Declared in <bslstl_sharedptr.h>

template<class DELETER>
shared_ptr(
    nullptr_t nullPointerLiteral,
    DELETER deleter,
    BloombergLP::bslma::Allocator* basicAllocator = 0);