Skip to content

Commit b653831

Browse files
committed
execution: product-type (#1384)
1 parent ff009c0 commit b653831

File tree

5 files changed

+78
-6
lines changed

5 files changed

+78
-6
lines changed

reference/execution/execution/basic-operation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ using indices-for = remove_reference_t<Sndr>::indices-for; // exposition only
111111
112112
説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。
113113
114-
- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md.nolink)型にまとめて返す。
114+
- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md)型にまとめて返す。
115115
116116
```cpp
117117
[]<class Sndr, class Rcvr, size_t... Is>(
@@ -124,7 +124,7 @@ using indices-for = remove_reference_t<Sndr>::indices-for; // exposition only
124124
}
125125
```
126126
* index_sequence[link /reference/utility/index_sequence.md]
127-
* product-type[link product-type.md.nolink]
127+
* product-type[link product-type.md]
128128
* connect[link connect.md]
129129
* basic-receiver[link basic-receiver.md.nolink]
130130
* integral_constant[link /reference/type_traits/integral_constant.md]

reference/execution/execution/basic-sender.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace std::execution {
3030
};
3131
}
3232
```
33-
* product-type[link product-type.md.nolink]
33+
* product-type[link product-type.md]
3434
* sender_t[link sender.md]
3535
* index_sequence_for[link /reference/utility/index_sequence_for.md]
3636
* impls-for[link impls-for.md]
@@ -45,7 +45,7 @@ namespace std::execution {
4545
`basic-sender<Tag, Data, Child...>`は[`sender`](sender.md)のモデルであり、[Senderアルゴリズム構築](make-sender.md)の結果型として利用される。
4646
4747
- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink))
48-
- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。
48+
- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。
4949
- `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。
5050
5151

reference/execution/execution/just.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace std::execution {
1818
1919
## 効果
2020
- 呼び出し式`just(ts...)`は、`(`[`movable-value`](../movable-value.md)`<Ts> &&...) == false`のとき不適格となる。
21-
- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md.nolink)`{ts...})`と等価。
21+
- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md)`{ts...})`と等価。
2222
2323
2424
### Senderアルゴリズムタグ `just`

reference/execution/execution/make-sender.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child);
1616
[`sender`](sender.md)のモデルである説明専用クラステンプレート[`basic-sender`](basic-sender.md)のインスタンスを生成する。
1717
1818
- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink))
19-
- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。
19+
- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。
2020
- `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。
2121
2222
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# product-type
2+
* execution[meta header]
3+
* class template[meta id-type]
4+
* std::execution[meta namespace]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
template<class T0, class T1, ..., class Tn>
9+
struct product-type { // exposition only
10+
T0 t0; // exposition only
11+
T1 t1; // exposition only
12+
// ...
13+
Tn tn; // exposition only
14+
15+
template<size_t I, class Self>
16+
constexpr decltype(auto) get(this Self&& self) noexcept; // exposition only
17+
18+
template<class Self, class Fn>
19+
constexpr decltype(auto) apply(this Self&& self, Fn&& fn) // exposition only
20+
noexcept(see below);
21+
};
22+
```
23+
* see below[italic]
24+
25+
## 概要
26+
`product-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。
27+
28+
`product-type`型の式は[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。
29+
30+
31+
## クラス仕様
32+
```cpp
33+
template<size_t I, class Self>
34+
constexpr decltype(auto) get(this Self&& self) noexcept;
35+
```
36+
37+
- 効果 : 下記と等価
38+
39+
```cpp
40+
auto& [...ts] = self;
41+
return std::forward_like<Self>(ts...[I]);
42+
```
43+
44+
```cpp
45+
template<class Self, class Fn>
46+
constexpr decltype(auto) apply(this Self&& self, Fn&& fn) noexcept(see below);
47+
```
48+
* see below[italic]
49+
50+
- テンプレートパラメータ制約 : 下記`return`文の式が適格であること。
51+
- 効果 : 下記と等価
52+
53+
```cpp
54+
auto& [...ts] = self;
55+
return std::forward<Fn>(fn)(std::forward_like<Self>(ts)...);
56+
```
57+
58+
- 備考 : `noexcept`節の式は上記`return`文が潜在的に例外送出しないならば`true`に、そうでなければ`false`となる。
59+
60+
61+
## バージョン
62+
### 言語
63+
- C++26
64+
65+
66+
## 関連項目
67+
- [`basic-sender`](basic-sender.md)
68+
69+
70+
## 参照
71+
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
72+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)

0 commit comments

Comments
 (0)