BloombergLP::bslma::AllocatorUtil::newObject

Allocate and default-construct a t_TYPE object.

Synopsis

Declared in <bslma_allocatorutil.h>

template<
    class t_TYPE,
    class t_ALLOCATOR>
static
AllocatorUtil_Traits<t_ALLOCATOR, t_TYPE>::pointer
newObject(t_ALLOCATOR const& allocator);

Description

Return an object of (template parameter) t_TYPE allocated from the specified allocator and constructed with no arguments except that, for scoped allocator types such as bsl::allocator and bsl::polymorphic_allocator, allocator may be passed to the t_TYPE constructor (i.e., if t_TYPE is AA).

Return Value

pointer to the newly allocated and default-constructed t_TYPE object

Parameters

NameDescription
allocatorallocator from which to allocate and possibly pass to the constructor