std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>::allocate
提供: cppreference.com
< cpp | memory | scoped allocator adaptor
ヘッダ <scoped_allocator> で定義
|
||
(1) | ||
pointer allocate( size_type n ); |
(C++11以上) (C++20未満) |
|
[[nodiscard]] pointer allocate( size_type n ); |
(C++20以上) | |
(2) | ||
pointer allocate( size_type n, const_void_pointer hint ); |
(C++11以上) (C++20未満) |
|
[[nodiscard]] pointer allocate( size_type n, const_void_pointer hint ); |
(C++20以上) | |
未初期化記憶域を確保するために外側のアロケータを使用します。
1) std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n) を呼びます。
2) std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n, hint) を呼ぶことによって、メモリの局所性のヒントを追加で提供します。
[編集] 引数
n | - | 何個のオブジェクトのための記憶域を確保するか |
hint | - | 近くのメモリ位置を指すポインタ |
[編集] 戻り値
確保した記憶域を指すポインタ。
[編集] 関連項目
未初期化記憶域を確保します ( std::allocator<T> のパブリックメンバ関数)
| |
[静的] |
アロケータを使用して未初期化記憶域を確保します ( std::allocator_traits<Alloc> のパブリック静的メンバ関数)
|