std::uses_allocator<std::tuple>
ja.cppreference.net より
| ヘッダ <tuple>
|
||
template< class... Types, class Alloc >
struct uses_allocator< std::tuple<Types...>, Alloc > : std::true_type { };
|
で定義 (C++11以上) | |
このstd::uses_allocatorの特殊化は、タプルがアロケータ使用構築をサポートすることを他のライブラリコンポーネントに通知します。ただし、タプル自体には入れ子の allocator_type はありません。
std:: integral_constant からの継承
メンバ定数
|
value
[static]
|
true
(public static member constant) |
メンバ関数
|
operator bool
|
オブジェクトを
bool
に変換し、
value
を返す
(public member function) |
|
operator()
(C++14)
|
value
を返す
(public member function) |
メンバ型
| 型 | 定義 |
value_type
|
bool |
type
|
std:: integral_constant < bool , value > |
例
// myallocは単一引数のコンストラクタを持つステートフルなAllocator // このコンストラクタはintを引数に取る。デフォルトコンストラクタは持たない。 using innervector_t = std::vector<int, myalloc<int>>; using elem_t = std::tuple<int, innervector_t>; using Alloc = std::scoped_allocator_adaptor< myalloc<elem_t>, myalloc<int>>; Alloc a(1,2); std::vector<elem_t, Alloc> v(a); v.resize(1); // vの要素に対してアロケータ#1を使用 std::get<1>(v[0]).resize(10); // innervector_tに対してアロケータ#2を使用
関連項目
|
(C++11)
|
指定された型がuses-allocator構築をサポートするかどうかをチェックする
(クラステンプレート) |