BloombergLP::bslstl::SharedPtrUtil::createInplaceUninitializedBuffer

Return a shared_ptr to a newly allocated uninitialized buffer.

Synopsis

Declared in <bslstl_sharedptr.h>

static
bsl::shared_ptr<char>
createInplaceUninitializedBuffer(
    size_t bufferSize,
    bslma::Allocator* basicAllocator = 0);

Description

Return a shared pointer with an in-place representation holding a newly-created uninitialized buffer of the specified bufferSize (in bytes). Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < bufferSize.

Return Value

shared pointer to a newly allocated uninitialized buffer

Parameters

NameDescription
bufferSizesize in bytes of the uninitialized buffer
basicAllocatorallocator used to supply memory