Skip to content

Commit 9fee4b5

Browse files
committed
executuon: LWG4203
1 parent 664d069 commit 9fee4b5

File tree

6 files changed

+23
-10
lines changed

6 files changed

+23
-10
lines changed

reference/execution/execution/into_variant.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ namespace std::execution {
5252
5353
```cpp
5454
[]<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept
55-
-> type_identity<value_types_of_t<child-type<Sndr>, env_of_t<Rcvr>>> {
55+
-> type_identity<value_types_of_t<child-type<Sndr>, FWD-ENV-T(env_of_t<Rcvr>)>> {
5656
return {};
5757
}
5858
```
5959
* type_identity[link /reference/type_traits/type_identity.md]
6060
* value_types_of_t[link value_types_of_t.md]
6161
* child-type[link child-type.md]
62+
* FWD-ENV-T[link ../forwarding_query.md]
6263
* env_of_t[link env_of_t.md]
6364

6465
`impls-for<into_variant_t>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。
@@ -205,3 +206,4 @@ int main()
205206
## 参照
206207
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
207208
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
209+
- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203)

reference/execution/execution/let_value.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace std::execution {
8484
}
8585
```
8686

87-
- 説明用のパック`Sigs`[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`<Sndr>,` [`env_of_t`](env_of_t.md)`<Rcvr>>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs``Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<set-cpo>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple<Tag(Args...)>`[`decayed-tuple`](decayed-tuple.md)`<Args...>`と定義する。型`args_variant_t`は下記定義において重複削除した型となる。
87+
- 説明用のパック`Sigs`[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`<Sndr>,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`<Rcvr>)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs``Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<set-cpo>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple<Tag(Args...)>`[`decayed-tuple`](decayed-tuple.md)`<Args...>`と定義する。型`args_variant_t`は下記定義において重複削除した型となる。
8888

8989
```cpp
9090
variant<monostate, as-tuple<LetSigs>...>
@@ -215,7 +215,7 @@ namespace std::execution {
215215
メンバ関数`receiver2::get_env`の呼び出しは、下記を満たすオブジェクト`e`を返す。
216216
217217
- 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ
218-
- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`env.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。
218+
- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`env.query(q)`が有効ならばその式と等価。そうではなく、`q`の型が[`forwarding-query`](../forwarding-query.md)を満たすならば式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。そうでなければ、式`e.query(q)`は不適格となる
219219
220220
221221
## カスタマイゼーションポイント
@@ -407,5 +407,6 @@ catch 0
407407
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
408408
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
409409
- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html)
410+
- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203)
410411
- [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204)
411412
- [LWG 4205. `let_[*].transform_env` is specified in terms of the `let_*` sender itself instead of its child](https://cplusplus.github.io/LWG/issue4205)

reference/execution/execution/schedule_from.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace std::execution {
6767

6868
```cpp
6969
[]<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept(see below)
70-
requires sender_in<child-type<Sndr>, env_of_t<Rcvr>> {
70+
requires sender_in<child-type<Sndr>, FWD-ENV-T(env_of_t<Rcvr>)> {
7171

7272
auto& [_, sch, child] = sndr;
7373

@@ -91,14 +91,15 @@ namespace std::execution {
9191
```
9292
* sender_in[link sender_in.md]
9393
* child-type[link child-type.md]
94+
* FWD-ENV-T[link ../forwarding_query.md]
9495
* env_of_t[link env_of_t.md]
9596
* connect_result_t[link connect_result_t.md]
9697
* schedule_result_t[link schedule_result_t.md]
9798
* connect[link connect.md]
9899
* schedule[link schedule.md]
99100

100101
- ローカルクラス`state-type`のオブジェクトは[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。
101-
- 説明用のパック`Sigs`[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`<Sndr>,` [`env_of_t`](env_of_t.md)`<Rcvr>>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple<Tag(Args...)>`[`decayed-tuple`](decayed-tuple.md)`<Args...>`と定義する。型`variant_t`は下記定義において重複削除した型となる。
102+
- 説明用のパック`Sigs`[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`<Sndr>,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`<Rcvr>)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple<Tag(Args...)>`[`decayed-tuple`](decayed-tuple.md)`<Args...>`と定義する。型`variant_t`は下記定義において重複削除した型となる。
102103

103104
```cpp
104105
variant<monostate, as-tuple<Sigs>...>
@@ -211,3 +212,4 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、
211212
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
212213
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
213214
- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html)
215+
- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203)

reference/execution/execution/stopped_as_optional.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ transform_sender(get-domain-early(sndr), make-sender(stopped_as_optional, {}, sn
3030

3131

3232
### Senderアルゴリズムタグ `stopped_as_optional`
33-
説明用の式`sndr``env`に対して、型`Sndr``decltype((sndr))`、型`Env``decltype((env))`とする。[`sender-for`](sender-for.md)`<Sndr, stopped_as_optional_t> == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)`<Sndr, Env>`が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。
33+
説明用の式`sndr``env`に対して、型`Sndr``decltype((sndr))`、型`Env``decltype((env))`とする。[`sender-for`](sender-for.md)`<Sndr, stopped_as_optional_t> == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)`<`[`child-type`](child-type.md)`<Sndr>,` [`FWD-ENV-T`](../forwarding_query.md)`(Env)>`が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。
3434

3535
そうでなければ、式`stopped_as_optional.transform_sender(sndr, env)`は下記と等価。
3636

3737
```cpp
3838
auto&& [_, _, child] = sndr;
39-
using V = single-sender-value-type<Sndr, Env>;
39+
using V = single-sender-value-type<child-type<Sndr>, FWD-ENV-T(Env)>;
4040
return let_stopped(
4141
then(std::forward_like<Sndr>(child),
4242
[]<class... Ts>(Ts&&... ts) noexcept(is_nothrow_constructible_v<V, Ts...>) {
@@ -45,6 +45,8 @@ return let_stopped(
4545
[]() noexcept { return just(optional<V>()); });
4646
```
4747
* single-sender-value-type[link single-sender-value-type.md]
48+
* child-type[link child-type.md]
49+
* FWD-ENV-T[link ../forwarding_query.md]
4850
* let_stopped[link let_stopped.md]
4951
* then[link then.md]
5052
* just[link just.md]
@@ -164,3 +166,4 @@ stopped
164166
## 参照
165167
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
166168
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
169+
- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203)

reference/execution/execution/when_all.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace std::execution {
8787
8888
- `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ
8989
- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ
90-
- [`get_stop_token`](../get_stop_token.md)以外の[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。
90+
- [`get_stop_token`](../get_stop_token.md)以外かつ[`forwarding-query`](../forwarding-query.md)を満たす[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。
9191
9292
`impls-for<when_all_t>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。
9393
@@ -212,7 +212,7 @@ enum class disposition { started, error, stopped }; // exposition only
212212
```cpp
213213
template<class Rcvr>
214214
struct make-state {
215-
template<max-1-sender-in<env_of_t<Rcvr>>... Sndrs>
215+
template<max-1-sender-in<FWD-ENV-T(env_of_t<Rcvr>)>... Sndrs>
216216
auto operator()(auto, auto, Sndrs&&... sndrs) const {
217217
using values_tuple = see below;
218218
using errors_variant = see below;
@@ -239,6 +239,7 @@ struct make-state {
239239
}
240240
};
241241
```
242+
* FWD-ENV-T[link ../forwarding_query.md]
242243
* env_of_t[link env_of_t.md]
243244
* stop_token_of_t[link ../stop_token_of_t.md]
244245
* on-stop-request[link on-stop-request.md]
@@ -254,9 +255,10 @@ struct make-state {
254255
型`values_tuple`は、適格であるならば下記の型とする。そうでなければ、[`tuple<>`](/reference/tuple/tuple.md)とする。
255256
256257
```cpp
257-
tuple<value_types_of_t<Sndrs, env_of_t<Rcvr>, decayed-tuple, optional>...>
258+
tuple<value_types_of_t<Sndrs, FWD-ENV-T(env_of_t<Rcvr>), decayed-tuple, optional>...>
258259
```
259260
* value_types_of_t[link value_types_of_t.md]
261+
* FWD-ENV-T[link ../forwarding_query.md]
260262
* env_of_t[link env_of_t.md]
261263
* decayed-tuple[link decayed-tuple.md]
262264
* optional[link /reference/optional/optional.md]
@@ -477,4 +479,5 @@ error=-2
477479
- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html)
478480
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
479481
- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html)
482+
- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203)
480483
- [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227)

reference/execution/forwarding_query.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ namespace std {
2222
- `forwarding_query(q) == false`ならば、式`FWD-ENV(env).query(q, as...)`は不適格となる。
2323
- そうでなければ、式`FWD-ENV(env)`は式`env.query(q, as...)`と等価であり、その型は[`queryable`](queryable.md)を満たす。
2424
25+
また、説明専用の型`FWD-ENV-T(Env)`を`decltype(FWD-ENV(declval<Env>()))`と定義する。
26+
2527
2628
## 効果
2729
説明用の式`q`を`Q`型の[クエリオブジェクト](queryable.md)としたとき、呼び出し式`forwarding_query(q)`は下記と等価であり、`bool`型の値となる。

0 commit comments

Comments
 (0)