Skip to content

Commit 1cb82c9

Browse files
committed
execution: forwarding_query (#1384)
1 parent cef1c67 commit 1cb82c9

10 files changed

Lines changed: 85 additions & 10 deletions

reference/execution/execution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ namespace std::execution {
3535
3636
| 名前 | 説明 | 対応バージョン |
3737
|------|------|----------------|
38-
| [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 |
38+
| [`forwarding_query`](forwarding_query.md) | 対象クエリオブジェクトの転送可否を取得するクエリオブジェクト (customization point object) | C++26 |
3939
| [`get_allocator`](get_allocator.md) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 |
4040
| [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 |
4141
| [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 |
4242
| [`execution::get_domain`](execution/get_domain.md) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 |
4343
| [`execution::get_scheduler`](execution/get_scheduler.md) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
4444
| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) | 委任Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
45-
| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 |
46-
| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 |
45+
| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前方進行保証 (enum) | C++26 |
46+
| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前方進行保証取得のクエリオブジェクト (customization point object) | C++26 |
4747
| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
4848
| [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 |
4949
| [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 |

reference/execution/execution/get_completion_scheduler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace std::execution {
1919
`get_completion_scheduler<completion-tag>`は、[Sender](sender.md)の[属性](get_env.md)から指定完了タグに関連付けられた完了Schedulerを取得する[クエリオブジェクト](../queryable.md)である。
2020
完了タグ`completion-tag`には、[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれかを指定する。
2121
22-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_completion_scheduler<completion-tag>)`は`true`値を返す。
22+
コア定数式[`forwarding_query`](../forwarding_query.md)`(get_completion_scheduler<completion-tag>)`は`true`値を返す。
2323
2424
2525
### 完了Scheduler

reference/execution/execution/get_delegation_scheduler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace std::execution {
1515
## 概要
1616
`get_delegation_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から委任[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。
1717
18-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_delegation_scheduler)`は`true`値を返す。
18+
コア定数式[`forwarding_query`](../forwarding_query.md)`(get_delegation_scheduler)`は`true`値を返す。
1919
2020
2121
## 効果

reference/execution/execution/get_domain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace std::execution {
1515
## 概要
1616
`get_domain`は、[クエリ可能オブジェクト](../queryable.md)から[実行ドメイン](default_domain.md)のタグ型を取得する[クエリオブジェクト](../queryable.md)である。
1717
18-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_domain)`は`true`値を返す。
18+
コア定数式[`forwarding_query`](../forwarding_query.md)`(get_domain)`は`true`値を返す。
1919
2020
2121
## 効果

reference/execution/execution/get_scheduler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace std::execution {
1515
## 概要
1616
`get_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。
1717
18-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_scheduler)`は`true`値を返す。
18+
コア定数式[`forwarding_query`](../forwarding_query.md)`(get_scheduler)`は`true`値を返す。
1919
2020
2121
## 効果

reference/execution/execution/impls-for.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace std::execution {
4444
return env<>();
4545
}
4646
```
47+
* FWD-ENV[link ../forwarding_query.md]
4748
* get_env[link get_env.md]
4849
* env<>[link env.md]
4950

@@ -59,6 +60,7 @@ namespace std::execution {
5960
return FWD-ENV(get_env(rcvr));
6061
}
6162
```
63+
* FWD-ENV[link ../forwarding_query.md]
6264
* get_env[link get_env.md]
6365
6466
### `get-state`メンバ
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# forwarding_query
2+
* execution[meta header]
3+
* cpo[meta id-type]
4+
* std[meta namespace]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std {
9+
struct forwarding_query_t { unspecified };
10+
inline constexpr forwarding_query_t forwarding_query{};
11+
}
12+
```
13+
* unspecified[italic]
14+
15+
## 概要
16+
`forwarding_query`は、対象[クエリオブジェクト](queryable.md)に対してクエリ可能アダプタを通じて転送可能か否かを確認するクエリオブジェクトである。
17+
18+
19+
### 説明専用の式 `FWD-ENV`
20+
説明用の[クエリ可能オブジェクト](queryable.md)`env`、[クエリオブジェクト](queryable.md)`q`、パック式`as`に対して、式`FWD-ENV(env)`は下記の通り定義される。
21+
22+
- `forwarding_query(q) == false`ならば、式`FWD-ENV(env).query(q, as...)`は不適格となる。
23+
- そうでなければ、式`FWD-ENV(env)`は式`env.query(q, as...)`と等価であり、その型は[`queryable`](queryable.md)を満たす。
24+
25+
26+
## 効果
27+
説明用の式`q`を`Q`型の[クエリオブジェクト](queryable.md)としたとき、呼び出し式`forwarding_query(q)`は下記と等価であり、`bool`型の値となる。
28+
29+
- 式`q.query(forwarding_query)`が適格であれば、同式の`bool`値。
30+
- `q`がコア定数式ならば、`q.query(forwarding_query)`もコア定数式となる。
31+
- そうではなく、[`derived_from`](/reference/concepts/derived_from.md)`<Q, forwarding_query_t> == true`ならば`true`
32+
- そうでなければ、`false`
33+
34+
35+
## カスタマイゼーションポイント
36+
[クエリ可能オブジェクト](queryable.md)`q`に対して式`q.query(forwarding_query)`が呼び出される。
37+
このとき`noexcept(q.query(forwarding_query)) == true`であること。
38+
39+
40+
## 備考
41+
下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送される。
42+
43+
- `forwarding_query`自身
44+
- [`get_allocator`](get_allocator.md)
45+
- [`get_stop_token`](get_stop_token.md)
46+
- [`execution::get_domain`](execution/get_domain.md)
47+
- [`execution::get_scheduler`](execution/get_scheduler.md)
48+
- [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md)
49+
- [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md)
50+
51+
下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送されない。
52+
53+
- [`execution​::​get_env`](execution/get_env.md)
54+
- [`executoin::get_forward_progress_guarantee`](executionget_forward_progress_guarantee.md.nolink)
55+
56+
57+
## バージョン
58+
### 言語
59+
- C++26
60+
61+
### 処理系
62+
- [Clang](/implementation.md#clang): ??
63+
- [GCC](/implementation.md#gcc): ??
64+
- [ICC](/implementation.md#icc): ??
65+
- [Visual C++](/implementation.md#visual_cpp): ??
66+
67+
68+
## 関連項目
69+
- [`impls-for`](execution/impls-for.md)
70+
71+
72+
## 参照
73+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)

reference/execution/get_allocator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace std {
1515
## 概要
1616
`get_allocator`は、[クエリ可能オブジェクト](queryable.md)からアロケータを取得する[クエリオブジェクト](queryable.md)である。
1717
18-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_allocator)`は`true`値を返す。
18+
コア定数式[`forwarding_query`](forwarding_query.md)`(get_allocator)`は`true`値を返す。
1919
2020
2121
## 効果

reference/execution/get_stop_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace std {
1515
## 概要
1616
`get_stop_token`は、[クエリ可能オブジェクト](queryable.md)から[停止トークン](/reference/stop_token/stoppable_token.md)を取得する[クエリオブジェクト](queryable.md)である。
1717
18-
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_stop_token)`は`true`値を返す。
18+
コア定数式[`forwarding_query`](forwarding_query.md)`(get_stop_token)`は`true`値を返す。
1919
2020
2121
## 効果

reference/execution/this_thread/sync-wait-receiver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void set_error(Error&& err) && noexcept
7171
7272
説明用の式`err`に対して`decltype((err))`を型`Err`としたとき、式`AS-EXCEPT-PTR(err)`を下記の通り定義する。
7373
74-
- [`decay_t`](/reference/type_traits/decay.md)`<Err>`が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`を満たすこと
74+
- [`decay_t`](/reference/type_traits/decay.md)`<Err>`が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`であること
7575
- そうではなく、[`decay_t`](/reference/type_traits/decay.md)`<Err>`が[`error_code`](/reference/system_error/error_code.md)型と等しければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(`[`system_error`](/reference/system_error/system_error.md)`(err))`となる。
7676
- そうでなければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(err)`となる。
7777

0 commit comments

Comments
 (0)