Skip to content

Commit 42347c5

Browse files
committed
lang/cpp26/embed.md,reference/execution/execution.md reference/execution/execution/completion_signatures.md,reference/execution/execution/connect.md reference/execution/execution/env.md,reference/execution/execution/env/query.md reference/execution/execution/error_types_of_t.md,reference/execution/execution/gather-signatures.md reference/execution/execution/get-domain-late.md,reference/execution/execution/get_completion_scheduler.md reference/execution/execution/get_delegation_scheduler.md,reference/execution/execution/get_domain.md reference/execution/execution/get_env.md,reference/execution/execution/get_scheduler.md reference/execution/execution/prop.md,reference/execution/execution/schedule.md reference/execution/execution/scheduler.md,reference/execution/execution/sender_in.md reference/execution/execution/sends_stopped.md,reference/execution/execution/value_types_of_t.md reference/execution/get_allocator.md,reference/execution/get_stop_token.md reference/execution/queryable.md,reference/execution/stop_token_of_t.md:
Merge branch 'master' of github.com:cpprefjp/site
2 parents 586dfed + 0c1871f commit 42347c5

24 files changed

Lines changed: 804 additions & 46 deletions

lang/cpp26/embed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int main() {
6363
- `limit(1024)`では、読み込むバイトサイズを1024byteに制限する。もしファイルサイズが1024byteよりも大きければ、最初の1024バイトのみが読み込まれる。
6464
- `prefix(0x01, 0x02, 0x03)`では、`data.bin`の内容の前に`0x01 0x02 0x03`のバイト列を追加している。
6565
- `suffix(0xFE, 0xFF)`では、`data.bin`の内容のあとに`0xFE 0xFF`のバイト列を追加している。
66-
- `if_empty(0x00)`では、`data.bin`がからであった場合`0x00`のバイト列を格納している。
66+
- `if_empty(0x00)`では、`data.bin`が空であった場合`0x00`のバイト列を格納している。
6767

6868
また、`#embed`ディレクティブは、複数のパラメータを**順不同**で組み合わせて指定することもできる。
6969

reference/execution/execution.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ namespace std::execution {
3636
| 名前 | 説明 | 対応バージョン |
3737
|------|------|----------------|
3838
| [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 |
39-
| [`get_allocator`](get_allocator.md.nolink) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 |
40-
| [`get_stop_token`](get_stop_token.md.nolink) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 |
41-
| [`stop_token_of_t`](get_stop_token.md.nolink) | 指定型から停止トークン型を取得 (alias template) | C++26 |
42-
| [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 |
43-
| [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
44-
| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
39+
| [`get_allocator`](get_allocator.md) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 |
40+
| [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 |
41+
| [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 |
42+
| [`execution::get_domain`](execution/get_domain.md) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 |
43+
| [`execution::get_scheduler`](execution/get_scheduler.md) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
44+
| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) | 委任Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
4545
| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 |
4646
| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 |
47-
| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 |
47+
| [`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 |
5050
| [`execution::prop`](execution/prop.md) | Key/Valueペアによる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 |
@@ -85,9 +85,9 @@ namespace std::execution {
8585
| [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 |
8686
| [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (customization point object) | C++26 |
8787
| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 |
88-
| [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 |
89-
| [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 |
90-
| [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 |
88+
| [`execution::value_types_of_t`](execution/value_types_of_t.md) | Senderの値完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 |
89+
| [`execution::error_types_of_t`](execution/error_types_of_t.md) | Senderのエラー完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 |
90+
| [`execution::sends_stopped`](execution/sends_stopped.md) | Senderが停止完了を送信しうるか否か (variable template) | C++26 |
9191
| [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 |
9292
| [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 |
9393
| [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 |

reference/execution/execution/completion_signatures.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ namespace std::execution {
1414
## 概要
1515
`completion_signatures`クラステンプレートは、完了シグネチャの集合をテンプレートパラメータとして表現する。
1616
17+
実行制御ライブラリ仕様定義では、説明専用のコンセプト`valid-completion-signatures`を利用する。
18+
19+
```cpp
20+
template<class Sigs>
21+
concept valid-completion-signatures = see below;
22+
```
23+
* see below[italic]
24+
25+
`Sigs`[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。
26+
1727

1828
## テンプレートパラメータ制約
1929
`Fns`の各要素`Fn`が、下記の説明専用コンセプト`completion-signature`を満たすこと。

reference/execution/execution/connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace std::execution {
1414
## 概要
1515
`connect`は、[Sender](sender.md)と[Receiver](receiver.md)を接続した結果[Operation State](operation_state.md)を返すカスタマイゼーションポイントオブジェクトである。
1616
17-
カスタマイゼーションポイントオブジェクトの呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。
17+
呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。
1818
1919
- [`transform_sender`](transform_sender.md)により`sndr`から新しいSender`new_sndr`へ変換する。(多くのケースで無変換)
2020
- 呼び出し式が適格であるならば、`new_sndr.connect(rcvr)`を返す。

reference/execution/execution/env.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ int main()
6161
```
6262
* ex::env[color ff0000]
6363
* ex::prop[link prop.md]
64-
* std::get_allocator[link get_allocator.md.nolink]
65-
* std::get_stop_token[link get_stop_token.md.nolink]
64+
* std::get_allocator[link ../get_allocator.md]
65+
* std::get_stop_token[link ../get_stop_token.md]
6666
* std::never_stop_token[link /reference/stop_token/never_stop_token.md]
6767

6868
### 出力

reference/execution/execution/env/query.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ constexpr decltype(auto) query(QueryTag q) const noexcept(see below);
1212
* see below[italic]
1313
1414
## 概要
15-
クエリオブジェクト`q`をキーとして、対応する値を問い合わせる。
15+
[クエリオブジェクト](../../queryable.md)`q`をキーとして、対応する値を問い合わせる。
1616
1717
1818
## テンプレートパラメータ制約
@@ -69,8 +69,8 @@ int main()
6969
* query[color ff0000]
7070
* ex::env[link ../env.md]
7171
* ex::prop[link ../prop.md]
72-
* std::get_allocator[link get_allocator.md.nolink]
73-
* std::get_stop_token[link get_stop_token.md.nolink]
72+
* std::get_allocator[link ../../get_allocator.md]
73+
* std::get_stop_token[link ../../get_stop_token.md]
7474
* std::never_stop_token[link /reference/stop_token/never_stop_token.md]
7575
* std::stop_token[link /reference/stop_token/stop_token.md]
7676

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# error_types_of_t
2+
* execution[meta header]
3+
* std::execution[meta namespace]
4+
* type-alias[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::execution {
9+
template<class Sndr, class Env = env<>,
10+
template<class...> class Variant = variant-or-empty>
11+
requires sender_in<Sndr, Env>
12+
using error_types_of_t =
13+
gather-signatures<set_error_t, completion_signatures_of_t<Sndr, Env>, type_identity_t, Variant>;
14+
}
15+
```
16+
* env<>[link env.md]
17+
* sender_in[link sender_in.md]
18+
* variant-or-empty[link variant-or-empty.md.nolink]
19+
* gather-signatures[link gather-signatures.md]
20+
* set_error_t[link set_error.md]
21+
* completion_signatures_of_t[link completion_signatures_of_t.md]
22+
* type_identity_t[link /reference/type_traits/type_identity.md]
23+
24+
## 概要
25+
[Sender型](sender.md)`Sndr`が[環境](receiver.md)`Env`において非同期操作を作成できるとき、[完了シグネチャ集合](completion_signatures.md)のうち[エラー完了シグネチャ](set_error.md)の引数型集合に対して型情報の変換操作を適用し、新たな型を取得する。
26+
27+
エラー完了シグネチャの引数型集合を`{E0, E1, ... EN}`としたとき、変換操作をテンプレートパラメータ`Variant`で指定する。
28+
29+
- `Variant` : 引数型集合に適用する型変換操作。
30+
31+
`error_types_of_t`のデフォルト動作では、引数型集合の[`variant`](/reference/variant/variant.md)に変換される。
32+
33+
34+
## 例
35+
```cpp example
36+
#include <concepts>
37+
#include <execution>
38+
namespace ex = std::execution;
39+
40+
int main()
41+
{
42+
// エラー完了シグネチャを持たないSender
43+
ex::sender auto snd1 = ex::just(123, 'X');
44+
using Types1 = ex::error_types_of_t<decltype(snd1)>;
45+
// Type1 == 有効だがオブジェクト構築不可な型
46+
47+
// エラー完了シグネチャ set_error_t(int)
48+
ex::sender auto snd2 = ex::just_error(42);
49+
using Types2 = ex::error_types_of_t<decltype(snd2)>;
50+
static_assert(std::same_as<Types2, std::variant<int>>);
51+
}
52+
```
53+
* ex::error_types_of_t[color ff0000]
54+
* ex::sender[link sender.md]
55+
* ex::just[link just.md.nolink]
56+
* ex::just_error[link just_error.md.nolink]
57+
58+
### 出力
59+
```
60+
```
61+
62+
63+
## バージョン
64+
### 言語
65+
- C++26
66+
67+
### 処理系
68+
- [Clang](/implementation.md#clang): ??
69+
- [GCC](/implementation.md#gcc): ??
70+
- [ICC](/implementation.md#icc): ??
71+
- [Visual C++](/implementation.md#visual_cpp): ??
72+
73+
74+
## 関連項目
75+
- [`execution::completion_signatures`](completion_signatures.md)
76+
- [`execution::set_error`](set_error.md)
77+
78+
79+
## 参照
80+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# gather-signatures
2+
* execution[meta header]
3+
* std::execution[meta namespace]
4+
* type-alias[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
template<class Tag,
9+
valid-completion-signatures Completions,
10+
template<class...> class Tuple,
11+
template<class...> class Variant>
12+
using gather-signatures = /*see below*/
13+
```
14+
* valid-completion-signatures[link completion_signatures.md]
15+
* see below[italic]
16+
17+
## 概要
18+
`gather-signatures`は、[完了シグネチャ集合](completion_signatures.md)`Completions`のうち完了タグ`Tag`に適合する引数型リスト集合に対して型情報の変換操作を適用し、新たな型を取得する説明専用のエイリアステンプレートである。
19+
20+
完了タグ`Tag`には下記いずれかの型を指定する。
21+
22+
- [`execution::set_value_t`](set_value.md)
23+
- [`execution::set_error_t`](set_error.md)
24+
- [`execution::set_stopped_t`](set_stopped.md)
25+
26+
完了シグネチャに適合する引数型リスト集合を`{Ts0..., Ts1..., ... TsN...}`としたとき、2段階の型変換操作をテンプレートパラメータ`Tuple`, `Variant`で指定する。
27+
28+
- `Tuple` : それぞれの引数型リスト`Ts...`に適用する型変換操作。
29+
- `Variant` : 上記変換後に、引数型リスト集合に適用する型変換操作。
30+
31+
32+
## バージョン
33+
### 言語
34+
- C++26
35+
36+
37+
## 関連項目
38+
- [`execution::value_types_of_t`](value_types_of_t.md)
39+
- [`execution::error_types_of_t`](error_types_of_t.md)
40+
- [`execution::sends_stopped`](sends_stopped.md)
41+
42+
43+
## 参照
44+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)

reference/execution/execution/get-domain-late.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept;
2525
}();
2626
```
2727
* query-or-default[link query-or-default.md.nolink]
28-
* get_domain[link get_domain.md.nolink]
28+
* get_domain[link get_domain.md]
2929
* default_domain()[link default_domain.md]
3030
3131
- それ以外のとき、下記リストのうち最初に妥当となる式の型、かつ`void`ではない型とする。
32-
- [`get_domain`](get_domain.md.nolink)`(`[`get_env`](get_env.md)`(sndr))`
32+
- [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))`
3333
- [`completion-domain`](completion-domain.md.nolink)`<void>(sndr)`
34-
- `get_domain(env)`
35-
- `get_domain(`[`get_scheduler`](get_scheduler.md.nolink)`(env))`
34+
- [`get_domain`](get_domain.md)`(env)`
35+
- [`get_domain`](get_domain.md)`(`[`get_scheduler`](get_scheduler.md)`(env))`
3636
- [`default_domain()`](default_domain.md)
3737
3838
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# get_completion_scheduler
2+
* execution[meta header]
3+
* cpo[meta id-type]
4+
* std::execution[meta namespace]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::execution {
9+
template<class CPO>
10+
struct get_completion_scheduler_t { unspecified };
11+
12+
template<class CPO>
13+
constexpr get_completion_scheduler_t<CPO> get_completion_scheduler{};
14+
}
15+
```
16+
* unspecified[italic]
17+
18+
## 概要
19+
`get_completion_scheduler<completion-tag>`は、[Sender](sender.md)の[属性](get_env.md)から指定完了タグに関連付けられた完了Schedulerを取得する[クエリオブジェクト](../queryable.md)である。
20+
完了タグ`completion-tag`には、[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれかを指定する。
21+
22+
コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_completion_scheduler<completion-tag>)`は`true`値を返す。
23+
24+
25+
### 完了Scheduler
26+
完了Scheduler(completion scheduler)は、非同期操作の完了操作を実行するための実行リソース(例:CPUスレッド)と関連付けられた[Scheduler](scheduler.md)である。
27+
28+
非同期操作の完了操作は、下記いずれかの完了関数呼び出しが該当する。
29+
30+
- 値完了関数 [`execution::set_value`](set_value.md)
31+
- エラー完了関数 [`execution::set_error`](set_error.md)
32+
- 停止完了関数 [`execution::set_stopped`](set_stopped.md)
33+
34+
35+
## 効果
36+
呼び出し式`get_completion_scheduler<completion-tag>(q)`は下記と等価であり、式が適格ならば[`scheduler`](scheduler.md)を満たす型の値となる。
37+
38+
- 引数`q`がconst修飾された`cq`を用いて、式`cq.query(get_completion_scheduler<completion-tag>)`が適格であればその値。
39+
- そうでなければ、呼び出し式は不適格となる。
40+
41+
42+
## 例外
43+
投げない
44+
45+
46+
## カスタマイゼーションポイント
47+
const修飾[クエリ可能オブジェクト](../queryable.md)`cq`に対して式`cq.query(get_completion_scheduler<completion-tag>)`が呼び出される。
48+
このとき、`noexcept(cq.query(get_completion_scheduler<completion-tag>)) == true`であること。
49+
50+
51+
## 例
52+
```cpp
53+
#include <execution>
54+
namespace ex = std::execution;
55+
56+
int main()
57+
{
58+
ex::run_loop loop;
59+
ex::scheduler auto loop_sch = loop.get_scheduler();
60+
61+
// schedule(loop_sch)の完了Schedulerはloop_schに等しい
62+
ex::sender auto snd0 = ex::schedule(loop_sch);
63+
auto sch0 = ex::get_completion_scheduler<ex::set_value_t>(ex::get_env(snd0));
64+
assert(sch0 == loop_sch);
65+
66+
// 完了Schedulerは接続されたSenderへと引き継がれる
67+
ex::sender auto snd1 = snd0 | ex::then([]{ return 42; });
68+
auto sch1 = ex::get_completion_scheduler<ex::set_value_t>(ex::get_env(snd1));
69+
assert(sch1 == loop_sch);
70+
71+
#if 0
72+
// just Senderは完了Schedulerを持たない
73+
ex::sender auto snd2 = ex::just(42);
74+
auto sch2 = ex::get_completion_scheduler<ex::set_value_t>(ex::get_env(snd2));
75+
#endif
76+
}
77+
```
78+
* ex::get_completion_scheduler[color ff0000]
79+
* ex::run_loop[link run_loop.md.nolink]
80+
* ex::scheduler[link scheduler.md]
81+
* ex::sender[link sender.md]
82+
* ex::schedule[link schedule.md]
83+
* ex::set_value_t[link set_value.md]
84+
* ex::get_env[link get_env.md]
85+
* ex::then[link then.md.nolink]
86+
87+
### 出力
88+
```
89+
```
90+
91+
92+
## バージョン
93+
### 言語
94+
- C++26
95+
96+
### 処理系
97+
- [Clang](/implementation.md#clang): ??
98+
- [GCC](/implementation.md#gcc): ??
99+
- [ICC](/implementation.md#icc): ??
100+
- [Visual C++](/implementation.md#visual_cpp): ??
101+
102+
103+
## 関連項目
104+
- [`execution::scheduler`](scheduler.md)
105+
- [`execution::schedule`](schedule.md)
106+
- [`execution::set_value`](set_value.md)
107+
- [`execution::set_error`](set_error.md)
108+
- [`execution::set_stopped`](set_stopped.md)
109+
110+
111+
## 参照
112+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)

0 commit comments

Comments
 (0)