std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>:: allocate
From cppreference.net
<
cpp
|
memory
|
scoped allocator adaptor
C++
Memory management library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::scoped_allocator_adaptor
| Member functions | ||||
|
scoped_allocator_adaptor::allocate
|
||||
| Non-member functions | ||||
|
(until C++20)
|
||||
| Deduction guides (C++17) |
|
ヘッダーで定義
<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>
の公開静的メンバ関数)
|