BloombergLP::bslma::SharedPtrOutofplaceRep::makeOutofplaceRep

Create a new out-of-place shared-pointer representation.

Synopsis

Declared in <bslma_sharedptroutofplacerep.h>

static
SharedPtrOutofplaceRep<TYPE, DELETER>*
makeOutofplaceRep(
    TYPE* ptr,
    DELETER const& deleter,
    Allocator* basicAllocator = 0);

Description

Return the address of a newly created SharedPtrOutofplaceRep object that manages the lifetime of the specified ptr, using the specified deleter to destroy ptr. Optionally, specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note that the parameterized DELETER type will be used to deallocate the memory pointed to by ptr.

Return Value

address of a newly created SharedPtrOutofplaceRep object

Parameters

NameDescription
ptraddress of the object whose lifetime is managed
deleterdeleter used to destroy ptr
basicAllocatormemory allocator; null uses the default