Return storage for n objects of value_type.

Synopsis

Declared in <bslma_bslallocator.h>

[[nodiscard]]
allocator<TYPE>::pointer
allocate(
    size_type n,
    void const* hint = 0);

Description

Return a block of memory having sufficient size and alignment to hold the specified n objects of value_type, allocated from the memory resource held by this allocator. The optionally specified hint is ignored by this allocator type but may be used by other allocators as an aid for optimizing locality.

Return Value

pointer to the allocated storage

Note

The return value should not be discarded.

Parameters

Name

Description

n

number of objects to allocate storage for

hint

optional locality hint (ignored by this allocator)

Created with MrDocs