Skip to content

Commit e4ffb85

Browse files
committed
execution: start (#1384)
1 parent 60b2958 commit e4ffb85

5 files changed

Lines changed: 93 additions & 6 deletions

File tree

reference/execution/execution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace std::execution {
7373
| 名前 | 説明 | 対応バージョン |
7474
|------|------|----------------|
7575
| [`execution::operation_state`](execution/operation_state.md) | Operation State型 (concept) | C++26 |
76-
| [`execution::start`](execution/start.md.nolink) | 非同期操作の開始 (customization point object) | C++26 |
76+
| [`execution::start`](execution/start.md) | 非同期操作の開始 (customization point object) | C++26 |
7777
7878
### Sender
7979

reference/execution/execution/connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ int main()
211211
* ex::sender[link sender.md]
212212
* ex::just[link just.md.nolink]
213213
* ex::operation_state[link operation_state.md]
214-
* ex::start[link start.md.nolink]
214+
* ex::start[link start.md]
215215
216216
### 出力
217217
```

reference/execution/execution/operation_state.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ namespace std::execution {
1919
```
2020
* derived_from[link /reference/concepts/derived_from.md]
2121
* is_object_v[link /reference/type_traits/is_object.md]
22-
* start[link start.md.nolink]
22+
* start[link start.md]
2323
2424
## 概要
2525
`operation_state`は、型`O`がOperation State型の要件を満たすことを表すコンセプトである。
2626
2727
下記をみたすクラス型はOperation Stateとみなせる。
2828
2929
- `operation_state_t`をメンバ型`O::operation_state_concept`として定義するクラス型
30-
- `O`型の左辺値`o`に対して[`execution::start`](start.md.nolink)`(o)`が有効な式かつ例外送出されないこと
30+
- `O`型の左辺値`o`に対して[`execution::start`](start.md)`(o)`が有効な式かつ例外送出されないこと
3131
3232
非同期操作の生存期間中に`operation_state`オブジェクトが破棄されると、未定義の動作を引き起こす。
3333
@@ -65,7 +65,7 @@ int main()
6565
* ex::sender[link sender.md]
6666
* ex::just[link just.md.nolink]
6767
* ex::connect[link connect.md]
68-
* ex::start[link start.md.nolink]
68+
* ex::start[link start.md]
6969

7070
### 出力
7171
```

reference/execution/execution/sender_to.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int main()
6161
* ex::just[link just.md.nolink]
6262
* ex::operation_state[link operation_state.md]
6363
* ex::connect[link connect.md]
64-
* ex::start[link start.md.nolink]
64+
* ex::start[link start.md]
6565

6666
### 出力
6767
```
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# start
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+
struct start_t;
10+
inline constexpr start_t start{};
11+
}
12+
```
13+
14+
## 概要
15+
`start`は、[Operation State](operation_state.md)を開始するカスタマイゼーションポイントオブジェクトである。
16+
17+
18+
## 効果
19+
式`start(op)`は、`op`が右辺値の場合は不適格となる。
20+
そうでなければ、`op.start()`と等価。
21+
22+
`op.start()`が[Operation State](operation_state.md)に関連付けさられた非同期操作を開始しない場合、式`start(op)`は未定義動作となる。
23+
24+
25+
## カスタマイゼーションポイント
26+
[Operation State](operation_state.md)`op`に対して式`op.start()`が呼び出される。
27+
このとき`noexcept(op.start()) == true`であること。
28+
29+
30+
## 例
31+
```cpp
32+
#include <print>
33+
#include <execution>
34+
namespace ex = std::execution;
35+
36+
struct ValueReceiver {
37+
using receiver_concept = ex::receiver_t;
38+
39+
void set_value(int v) && noexcept
40+
{
41+
std::println("{}", v);
42+
}
43+
};
44+
45+
int main()
46+
{
47+
// 値42を送信するSender
48+
ex::sender auto sndr = ex::just(42);
49+
// int値を受信して表示するReceiver
50+
ValueReceiver rcvr;
51+
52+
// SenderとReceiverを接続
53+
ex::operation_state auto op = ex::connect(sndr, rcvr);
54+
// Operation Stateを開始
55+
ex::start(op);
56+
}
57+
```
58+
* ex::start[color ff0000]
59+
* ex::receiver_t[link receiver.md]
60+
* ex::sender[link sender.md]
61+
* ex::just[link just.md.nolink]
62+
* ex::operation_state[link operation_state.md]
63+
* ex::connect[link connect.md]
64+
65+
### 出力
66+
```
67+
42
68+
```
69+
70+
71+
## バージョン
72+
### 言語
73+
- C++26
74+
75+
### 処理系
76+
- [Clang](/implementation.md#clang): ??
77+
- [GCC](/implementation.md#gcc): ??
78+
- [ICC](/implementation.md#icc): ??
79+
- [Visual C++](/implementation.md#visual_cpp): ??
80+
81+
82+
## 関連項目
83+
- [`execution::operation_state`](operation_state.md)
84+
85+
86+
## 参照
87+
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)

0 commit comments

Comments
 (0)