共用方式為


scoped_allocator_adaptor::allocate Method

Allocates memory by using the Outer allocator.

pointer allocate(size_type count);
pointer allocate(size_type count, const_void_pointer hint);

Parameters

  • count
    The number of elements for which sufficient storage is to be allocated.

  • hint
    A pointer that might assist the allocator object by locating the address of an object allocated prior to the request.

Return Value

The first member function returns Outer_traits::allocate(outer_allocator(), count). The second member function returns Outer_traits::allocate(outer_allocator(), count, hint).

Requirements

Header: <scoped_allocator>

Namespace: std

See Also

Reference

scoped_allocator_adaptor Class

allocator_traits::allocate Method