名前空間
変種
操作

std::tuple に対する推定ガイド

提供: cppreference.com
< cpp‎ | utility‎ | tuple
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ (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)
 
std::tuple
メンバ関数
非メンバ関数
(C++20未満)(C++20未満)(C++20未満)(C++20未満)(C++20未満)(C++20)
推定ガイド(C++17)
ヘルパークラス
 
ヘッダ <tuple> で定義
template<class... UTypes>
tuple(UTypes...) -> tuple<UTypes...>;
(1) (C++17以上)
template<class T1, class T2>
tuple(std::pair<T1, T2>) -> tuple<T1, T2>;
(2) (C++17以上)
template<class Alloc, class... UTypes>
tuple(std::allocator_arg_t, Alloc, UTypes...) -> tuple<UTypes...>;
(3) (C++17以上)
template<class Alloc, class T1, class T2>
tuple(std::allocator_arg_t, Alloc, std::pair<T1, T2>) -> tuple<T1, T2>;
(4) (C++17以上)
template<class Alloc, class... UTypes>
tuple(std::allocator_arg_t, Alloc, tuple<UTypes...>) -> tuple<UTypes...>;
(5) (C++17以上)

暗黙の推定ガイドで拾えないエッジケース、特にコピー可能でない引数や配列のポインタへの変換に対処するため、これらの推定ガイドstd::tuple に対して提供されます。

[編集]

#include <tuple>
int main()
{
    int a[2], b[3], c[4];
    std::tuple t1{a, b, c}; // explicit deduction guide is used in this case
}