std::allocator_traits
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <memory> で定義
|
||
template< class Alloc > struct allocator_traits; |
(C++11以上) | |
allocator_traits クラステンプレートは Allocator の様々な性質にアクセスするための標準的な方法を提供します。 標準のコンテナおよびその他の標準ライブラリのコンポーネントはこのテンプレートを通してアロケータにアクセスします。 これにより、 allocator_traits のユーザ提供の特殊化が必要な機能をすべて実装している限り、任意のクラス型をアロケータとして使用することができます。
デフォルトの特殊化されていない allocator_traits は以下のメンバを持ちます。
メンバ型
| 型 | 定義 |
allocator_type
|
Alloc
|
value_type
|
Alloc::value_type
|
pointer
|
存在すれば Alloc::pointer、そうでなければ value_type*
|
const_pointer
|
存在すれば Alloc::const_pointer、そうでなければ std::pointer_traits<pointer>::rebind<const value_type>
|
void_pointer
|
存在すれば Alloc::void_pointer、そうでなければ std::pointer_traits<pointer>::rebind<void>
|
const_void_pointer
|
存在すれば Alloc::const_void_pointer、そうでなければ std::pointer_traits<pointer>::rebind<const void>
|
difference_type
|
存在すれば Alloc::difference_type、そうでなければ std::pointer_traits<pointer>::difference_type
|
size_type
|
存在すれば Alloc::size_type、そうでなければ std::make_unsigned<difference_type>::type
|
propagate_on_container_copy_assignment
|
存在すれば Alloc::propagate_on_container_copy_assignment、そうでなければ std::false_type
|
propagate_on_container_move_assignment
|
存在すれば Alloc::propagate_on_container_move_assignment、そうでなければ std::false_type
|
propagate_on_container_swap
|
存在すれば Alloc::propagate_on_container_swap、そうでなければ std::false_type
|
is_always_equal(C++17以上)
|
存在すれば Alloc::is_always_equal、そうでなければ std::is_empty<Alloc>::type
|
メンバエイリアステンプレート
| 型 | 定義 |
rebind_alloc<T>
|
存在すれば Alloc::rebind<T>::other、そうでなくこの Alloc が Alloc<U, Args> であれば Alloc<T, Args>
|
rebind_traits<T>
|
std::allocator_traits<rebind_alloc<T>>
|
メンバ関数
[静的] |
アロケータを使用して未初期化記憶域を確保します (パブリック静的メンバ関数) |
[静的] |
アロケータを使用して記憶域を解放します (パブリック静的メンバ関数) |
[静的] |
確保された記憶域にオブジェクトを構築します (関数テンプレート) |
[静的] |
確保された記憶域に格納されているオブジェクトを破棄します (関数テンプレート) |
[静的] |
アロケータでサポートされている最大オブジェクトサイズを返します (パブリック静的メンバ関数) |
| 標準コンテナをコピーした後で使用するためのアロケータを取得します (パブリック静的メンバ関数) |
関連項目
| デフォルトのアロケータ (クラステンプレート) | |
(C++11) |
多段コンテナのための多段アロケータを実装します (クラステンプレート) |
(C++11) |
ポインタライクな型に関する情報を提供します (クラステンプレート) |