Namespaces
Variants
Views
Actions

std::scoped_allocator_adaptor::allocate

From cppreference.com
< cpp‎ | memory‎ | scoped allocator adaptor
Revision as of 16:32, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <scoped_allocator>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
pointer allocate( size_type n );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
pointer allocate( size_type n, const_void_pointer hint );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

1) Uses the outer allocator to allocate uninitialized storage, by calling std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n)

2) Uses the outer allocator to allocate uninitialized storage with the memory locality hint provided, by calling std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n, hint)

Parameters

n - the number of objects to allocate storage for
hint - pointer to a nearby memory location

Return value

The pointer to the allocated storage

See also

Template:cpp/memory/allocator/dcl list allocateTemplate:cpp/memory/allocator traits/dcl list allocate