BloombergLP::bslma::ManagedPtrUtil::allocateManaged

allocateManaged overloads

Synopses

Declared in <bslma_managedptr.h>

Create an object of the (template parameter) ELEMENT_TYPE from the specified args... arguments, and return a ManagedPtr to manage the new object. Use the specified allocator to supply memory for the footprint of the new object and implicitly pass allocator as the allocator argument to the ELEMENT_TYPE constructor if bslma::UsesBslmaAllocator<ELEMENT_TYPE>::value is true. If allocator is a null pointer, the currently installed default allocator is used. Note that compilation will fail unless allocator is convertible to either bslma::Allocator * or bsl::allocator<>.

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

Same as the overload taking bslma::Allocator *, but accepts 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...