bsl::allocator_traits<std::allocator<ALLOCATOR_TYPE>>::allocate

Allocate memory.

Synopses

Declared in <bslma_allocatortraits.h>

Allocate memory.

[[nodiscard]]
constexpr
static
pointer
allocate(
    _Alloc& __a,
    size_type __n);
» more...

Allocate memory.

[[nodiscard]]
constexpr
static
pointer
allocate(
    _Alloc& __a,
    size_type __n,
    const_void_pointer __hint);
» more...

Return Value

Memory of suitable size and alignment for n objects of type value_type

NOTE

The return value should not be discarded.

Parameters

NameDescription
__aAn allocator.
__nThe number of objects to allocate space for.
__hintAid to locality.