template<class T0, class T1, ..., class Tn>
struct product-type { // exposition only
T0 t0; // exposition only
T1 t1; // exposition only
// ...
Tn tn; // exposition only
template<size_t I, class Self>
constexpr decltype(auto) get(this Self&& self) noexcept; // exposition only
template<class Self, class Fn>
constexpr decltype(auto) apply(this Self&& self, Fn&& fn) // exposition only
noexcept(see below);
};
概要
product-type
は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。
product-type
型の式は構造化束縛における初期化子として利用できる。
クラス仕様
template<size_t I, class Self>
constexpr decltype(auto) get(this Self&& self) noexcept;
-
効果 : 下記と等価
auto& [...ts] = self; return std::forward_like<Self>(ts...[I]);
template<class Self, class Fn>
constexpr decltype(auto) apply(this Self&& self, Fn&& fn) noexcept(see below);
- テンプレートパラメータ制約 : 下記
return
文の式が適格であること。 -
効果 : 下記と等価
auto& [...ts] = self; return std::forward<Fn>(fn)(std::forward_like<Self>(ts)...);
-
備考 :
noexcept
節の式は上記return
文が潜在的に例外送出しないならばtrue
に、そうでなければfalse
となる。
バージョン
言語
- C++26