Allocate memory.

Synopsis

Declared in <bslma_allocatortraits.h>

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

Description

Returns if that expression is well‐formed, otherwise returns a.allocate(n)

Return Value

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

Note

The return value should not be discarded.

Parameters

Name

Description

__a

An allocator.

__n

The number of objects to allocate space for.

__hint

Aid to locality.

Created with MrDocs