Namespaces
Variants

std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>:: allocate

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
ヘッダーで定義 <scoped_allocator>
pointer allocate ( size_type n ) ;
(1) (C++11以降)
pointer allocate ( size_type n, const_void_pointer hint ) ;
(2) (C++11以降)

外部アロケータを使用して未初期化ストレージを割り当てます。

1) std:: allocator_traits < OuterAlloc > :: allocate ( outer_allocator ( ) , n ) を呼び出します。
2) さらに、メモリ局所性のヒントを提供し、 std:: allocator_traits < OuterAlloc > :: allocate ( outer_allocator ( ) , n, hint ) を呼び出します。

パラメータ

n - ストレージを割り当てるオブジェクトの数
hint - 近傍メモリ位置へのポインタ

戻り値

割り当てられたストレージへのポインタ。

関連項目

未初期化の記憶域を割り当てる
( std::allocator<T> の公開メンバ関数)
[static]
アロケータを使用して未初期化の記憶域を割り当てる
( std::allocator_traits<Alloc> の公開静的メンバ関数)