BloombergLP::bslma::ManagedPtrUtil::allocateManaged

allocateManaged overloads

Synopses

Declared in <bslma_managedptr.h>

Create and return a ManagedPtr to a new ELEMENT_TYPE object.

template<
    class ELEMENT_TYPE,
    class... ARGS>
static
ManagedPtr<ELEMENT_TYPE>
allocateManaged(
    bslma::Allocator* allocator,
    ARGS&&... args);
» more...

Create and return a ManagedPtr using a class-type allocator.

template<
    class ELEMENT_TYPE,
    class ALLOCATOR,
    class... ARGS>
static
ManagedPtr<ELEMENT_TYPE>
allocateManaged(
    ALLOCATOR const& allocator,
    ARGS&&... args)
requires bsl::is_class<ALLOCATOR>::value;
» more...

Return Value

ManagedPtr managing the newly created ELEMENT_TYPE object

Parameters

NameDescription
allocatorallocator used to supply memory for the new object
argsarguments forwarded to the ELEMENT_TYPE constructor