BloombergLP::bslma::AllocatorUtil::allocateObject

Return a pointer to a block of raw memory allocated from the specified allocator having a size and alignment appropriate for an object of (templatize parameter) t_TYPE. Optionally specify n for the number of objects; otherwise space for a single object is allocated. Since t_TYPE cannot be deduced from the function parameters, it must be supplied explicitly (in <> brackets) by the caller.

Synopsis

Declared in <bslma_allocatorutil.h>

template<
    class t_TYPE,
    class t_ALLOCATOR>
static
AllocatorUtil_Traits<t_ALLOCATOR, t_TYPE>::pointer
allocateObject(
    t_ALLOCATOR const& allocator,
    std::size_t n = 1);