std::uses_allocator<std::tuple>
From cppreference.com
| ヘッダ <tuple> で定義 |
||
| template< class... Types, class Alloc > struct uses_allocator< std::tuple<Types...>, Alloc > : std::true_type { }; |
(C++11以降) | |
このstd::uses_allocatorの特殊化は、タプルがネストされたallocator_typeを持っていなくても、タプルがuses-allocator構築をサポートしていることを他のライブラリコンポーネントに通知します。
目次 |
std::integral_constant から継承
メンバ定数
| value [static] |
true (公開静的メンバ定数) |
メンバ関数
| operator bool |
オブジェクトを bool に変換し、value を返します。 (public member function) |
| operator() (C++14) |
value を返します。 (public member function) |
メンバ型
| 型 | 定義 |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
[編集] 例
// myalloc is a stateful Allocator with a single-argument constructor // that takes an int. It has no default constructor. 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); // uses allocator #1 for elements of v std::get<1>(v[0]).resize(10); // uses allocator #2 for innervector_t
[編集] 関連項目
| (C++11) |
指定された型が uses-allocator 構築をサポートしているかどうかをチェックします (クラステンプレート) |