libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ allocate() [2/2]

template<typename _Alloc>
constexpr pointer std::allocator_traits< _Alloc >::allocate ( _Alloc & __a,
size_type __n,
const_void_pointer __hint )
inlinestaticnodiscardconstexpr

Allocate memory.

Parameters
__aAn allocator.
__nThe number of objects to allocate space for.
__hintAid to locality.
Returns
Memory of suitable size and alignment for n objects of type value_type

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

Definition at line 395 of file bits/alloc_traits.h.

400 {
Uniform interface to all allocator types.