名前空間
変種

std::uses_allocator<std::tuple>

提供: cppreference.com
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ (C++20)
(C++11)
関係演算子 (C++20で非推奨)
整数比較関数
(C++20)
スワップと型操作
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
一般的な語彙の型
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

初等文字列変換
(C++17)
(C++17)
 
 
<tbody> </tbody>
ヘッダ <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
[静的]
true
(パブリック静的メンバ定数)

メンバ関数

operator bool
オブジェクトを bool に変換します。 value を返します
(パブリックメンバ関数)
operator()
(C++14)
value を返します
(パブリックメンバ関数)

メンバ型

定義
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.

    typedef std::vector<int, myalloc<int>> innervector_t;
    typedef std::tuple<int, innervector_t> elem_t;
    typedef std::scoped_allocator_adaptor< myalloc<elem_t>, myalloc<int>> Alloc;
    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


関連項目

指定された型がアロケータ使用構築をサポートしているかどうか調べます
(クラステンプレート) [edit]