22<feed xmlns =" http://www.w3.org/2005/Atom" >
33 <title >cpprefjp - C++日本語リファレンス</title >
44 <link href =" https://cpprefjp.github.io" />
5- <updated >2026-01-16T14:52:51.170656 </updated >
6- <id >16d4bc8a-1316-4056-baa6-e5043ee66e20 </id >
5+ <updated >2026-01-16T17:05:45.475861 </updated >
6+ <id >3e29062a-7347-43ac-8415-17397d1b291d </id >
77
88
9+ <entry >
10+ <title >execution -- execution: P3552R3 affine_on(#1521)</title >
11+ <link href =" https://cpprefjp.github.io/reference/execution/execution.html" />
12+ <id >a9f176508a00cd5873f5dae1b28a325d9ee8ce28:reference/execution/execution.md</id >
13+ <updated >2026-01-17T02:01:12+09:00</updated >
14+
15+ <summary type =" html" >< pre>< code> diff --git a/reference/execution/execution.md b/reference/execution/execution.md
16+ index 2789282d1..2ab3e65dd 100644
17+ --- a/reference/execution/execution.md
18+ +++ b/reference/execution/execution.md
19+ @@ -160,7 +160,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間
20+ |------|------|----------------|
21+ | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 |
22+ | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 |
23+ -| [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 |
24+ +| [`execution::affine_on`](execution/affine_on.md) | タスクコルーチンのScheduler Affinityを実現 (customization point object) | C++26 |
25+ | [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 |
26+ | [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 |
27+ | [`execution::with_error`](execution/with_error.md) | タスクコルーチンからのエラー完了 (class template) | C++26 |
28+ < /code>< /pre> </summary >
29+
30+ <author >
31+ <name >yoh</name >
32+ <email >kawasaki.liamg@gmail.com</email >
33+ </author >
34+ </entry >
35+
36+ <entry >
37+ <title >affine_on -- execution: P3552R3 affine_on(#1521)</title >
38+ <link href =" https://cpprefjp.github.io/reference/execution/execution/affine_on.html" />
39+ <id >a9f176508a00cd5873f5dae1b28a325d9ee8ce28:reference/execution/execution/affine_on.md</id >
40+ <updated >2026-01-17T02:01:12+09:00</updated >
41+
42+ <summary type =" html" >< pre>< code> diff --git a/reference/execution/execution/affine_on.md b/reference/execution/execution/affine_on.md
43+ new file mode 100644
44+ index 000000000..fb44e610d
45+ --- /dev/null
46+ +++ b/reference/execution/execution/affine_on.md
47+ @@ -0,0 +1,91 @@
48+ +# affine_on
49+ +* execution[meta header]
50+ +* cpo[meta id-type]
51+ +* std::execution[meta namespace]
52+ +* cpp26[meta cpp]
53+ +
54+ +```cpp
55+ +namespace std::execution {
56+ + struct affine_on_t { unspecified };
57+ + inline constexpr affine_on_t affine_on{};
58+ +}
59+ +```
60+ +* unspecified[italic]
61+ +
62+ +## 概要
63+ +`affine_on`は、指定[Scheduler](scheduler.md)上で完了させるSenderアダプタである。
64+ +アダプト対象Senderが正しいScheduler上で完了すると判断できるとき、アルゴリズムはスケジューリング操作を回避できる。
65+ +
66+ +`affine_on`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。
67+ +
68+ +
69+ +## 効果
70+ +説明用の式`sch`と`sndr`に対して、`decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`affine_on(sndr, sch)`は不適格となる。
71+ +
72+ +そうでなければ、呼び出し式`affine_on(sndr, sch)`は`sndr`が1回だけ評価されることを除いて、下記と等価。
73+ +
74+ +```cpp
75+ +transform_sender(get-domain-early(sndr), make-sender(affine_on, sch, sndr))
76+ +```
77+ +* transform_sender[link transform_sender.md]
78+ +* get-domain-early[link get-domain-early.md]
79+ +* make-sender[link make-sender.md]
80+ +
81+ +
82+ +### Senderアルゴリズムタグ `affine_on`
83+ +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。
84+ +
85+ +```cpp
86+ +namespace std::execution {
87+ + template& lt;& gt;
88+ + struct impls-for& lt;affine_on_t& gt; : default-impls {
89+ + static constexpr auto get-attrs =
90+ + [](const auto& amp; data, const auto& amp; child) noexcept -& gt; decltype(auto) {
91+ + return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child)));
92+ + };
93+ + };
94+ +}
95+ +```
96+ +* impls-for[link impls-for.md]
97+ +* default-impls[link impls-for.md]
98+ +* JOIN-ENV[link ../queryable.md]
99+ +* SCHED-ATTRS[link scheduler.md]
100+ +* FWD-ENV[link ../forwarding_query.md]
101+ +* get_env[link get_env.md]
102+ +
103+ +
104+ +## カスタマイゼーションポイント
105+ +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。
106+ +[デフォルト実行ドメイン](default_domain.md)では無変換。
107+ +
108+ +説明用の式`out_sndr`を`affine_on(sndr, sch)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)`& lt;OutSndr, Env& gt; == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、
109+ +
110+ +- 呼び出し[`start`](start.md)`(op)`は、現在の実行エージェント上で入力[Sender](sender.md)`sndr`を開始し、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で`out_rcvr`の完了操作が実行される。
111+ +- 現在の実行リソースが`sch`に関連付けられた実行リソースと同一のとき、[`start`](start.md)`(op)`の完了よりも前に`out_rcvr`の完了操作が呼ばれる可能性がある。
112+ +- `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。
113+ +
114+ +
115+ +## 備考
116+ +`affine_on`アルゴリズムの動作は[`continues_on`](continues_on.md)と等価だが、処理系は不要なスケジューリング操作を省略(最適化)する可能性がある。
117+ +
118+ +`affine_on`は[タスクコルーチン](task.md)のScheduler Affinity実現に用いられる。
119+ +詳細仕様は[`task::promise::await_transform`](task/promise_type/await_transform.md)を参照のこと。
120+ +
121+ +
122+ +## バージョン
123+ +### 言語
124+ +- C++26
125+ +
126+ +### 処理系
127+ +- [Clang](/implementation.md#clang): ??
128+ +- [GCC](/implementation.md#gcc): ??
129+ +- [ICC](/implementation.md#icc): ??
130+ +- [Visual C++](/implementation.md#visual_cpp): ??
131+ +
132+ +
133+ +## 関連項目
134+ +- [`execution::task`](task.md)
135+ +
136+ +
137+ +## 参照
138+ +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html)
139+ < /code>< /pre> </summary >
140+
141+ <author >
142+ <name >yoh</name >
143+ <email >kawasaki.liamg@gmail.com</email >
144+ </author >
145+ </entry >
146+
147+ <entry >
148+ <title >get-domain-early -- execution: P3552R3 affine_on(#1521)</title >
149+ <link href =" https://cpprefjp.github.io/reference/execution/execution/get-domain-early.html" />
150+ <id >a9f176508a00cd5873f5dae1b28a325d9ee8ce28:reference/execution/execution/get-domain-early.md</id >
151+ <updated >2026-01-17T02:01:12+09:00</updated >
152+
153+ <summary type =" html" >< pre>< code> diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md
154+ index b0f50fc3a..bdcfebfa0 100644
155+ --- a/reference/execution/execution/get-domain-early.md
156+ +++ b/reference/execution/execution/get-domain-early.md
157+ @@ -46,7 +46,7 @@ constexpr auto get-domain-early(const Sndr& amp; sndr) noexcept;
158+ - [`execution::stopped_as_optional`](stopped_as_optional.md)
159+ - [`execution::stopped_as_error`](stopped_as_error.md)
160+ - [`execution::associate`](associate.md)
161+ -- [`execution::affine_on`](affine_on.md.nolink)
162+ +- [`execution::affine_on`](affine_on.md)
163+ - [`this_thread::sync_wait`](../this_thread/sync_wait.md)
164+ - [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md)
165+
166+ < /code>< /pre> </summary >
167+
168+ <author >
169+ <name >yoh</name >
170+ <email >kawasaki.liamg@gmail.com</email >
171+ </author >
172+ </entry >
173+
174+ <entry >
175+ <title >await_transform -- execution: P3552R3 affine_on(#1521)</title >
176+ <link href =" https://cpprefjp.github.io/reference/execution/execution/task/promise_type/await_transform.html" />
177+ <id >a9f176508a00cd5873f5dae1b28a325d9ee8ce28:reference/execution/execution/task/promise_type/await_transform.md</id >
178+ <updated >2026-01-17T02:01:12+09:00</updated >
179+
180+ <summary type =" html" >< pre>< code> diff --git a/reference/execution/execution/task/promise_type/await_transform.md b/reference/execution/execution/task/promise_type/await_transform.md
181+ index 5b473a780..a232bad3c 100644
182+ --- a/reference/execution/execution/task/promise_type/await_transform.md
183+ +++ b/reference/execution/execution/task/promise_type/await_transform.md
184+ @@ -22,8 +22,8 @@ auto await_transform(change_coroutine_scheduler& lt;Sch& gt; sch); // (2)
185+
186+ ## 効果
187+ - (1) :
188+ - - [`same_as`](/reference/concepts/same_as.md)`& lt;`[`inline_scheduler`](../../inline_scheduler.md)`, `[`scheduler_type`](../../task.md)`& gt; == true`ならば、[`as_awaitable`](../../as_awaitable.md)`(std::forward& lt;Sender& gt;(sndr), *this)`を返す。
189+ - - そうでなければ、[`as_awaitable`](../../as_awaitable.md)`(`[`affine_on`](../../affine_on.md.nolink)`(std::forward& lt;Sender& gt;(sndr), SCHED(*this)), *this)`を返す。
190+ + - [`same_as`](/reference/concepts/same_as.md)`& lt;`[`inline_scheduler`](../../inline_scheduler.md)`,` [`scheduler_type`](../../task.md)`& gt; == true`ならば、[`as_awaitable`](../../as_awaitable.md)`(std::forward& lt;Sender& gt;(sndr), *this)`を返す。
191+ + - そうでなければ、[`as_awaitable`](../../as_awaitable.md)`(`[`affine_on`](../../affine_on.md)`(std::forward& lt;Sender& gt;(sndr), SCHED(*this)), *this)`を返す。
192+ - (2) : 以下と等価
193+
194+ ```cpp
195+ @@ -48,7 +48,7 @@ auto await_transform(change_coroutine_scheduler& lt;Sch& gt; sch); // (2)
196+
197+ ## 関連項目
198+ - [`execution::as_awaitable`](../../as_awaitable.md)
199+ -- [`execution::affine_on`](../../affine_on.md.nolink)
200+ +- [`execution::affine_on`](../../affine_on.md)
201+ - [`execution::inline_scheduler`](../../inline_scheduler.md)
202+ - [`execution::change_coroutine_scheduler`](../../change_coroutine_scheduler.md)
203+
204+ < /code>< /pre> </summary >
205+
206+ <author >
207+ <name >yoh</name >
208+ <email >kawasaki.liamg@gmail.com</email >
209+ </author >
210+ </entry >
211+
9212 <entry >
10213 <title >logic_error -- fix logic_error.md</title >
11214 <link href =" https://cpprefjp.github.io/reference/stdexcept/logic_error.html" />
@@ -519,37 +722,4 @@ index 000000000..155ecec11
519722 </author >
520723 </entry >
521724
522- <entry >
523- <title >return_value -- execution/task/promise_type: LWG4345適用(#1521)</title >
524- <link href =" https://cpprefjp.github.io/reference/execution/execution/task/promise_type/return_value.html" />
525- <id >086802a0fe15b519173ff1093db58c3b9b1174bb:reference/execution/execution/task/promise_type/return_value.md</id >
526- <updated >2026-01-16T08:10:36+09:00</updated >
527-
528- <summary type =" html" >< pre>< code> diff --git a/reference/execution/execution/task/promise_type/return_value.md b/reference/execution/execution/task/promise_type/return_value.md
529- index 1364540b6..a3b84244b 100644
530- --- a/reference/execution/execution/task/promise_type/return_value.md
531- +++ b/reference/execution/execution/task/promise_type/return_value.md
532- @@ -7,7 +7,7 @@
533-
534- ```cpp
535- // is_void_v& lt;T& gt; == false 時のみ存在
536- -template& lt;class V& gt;
537- +template& lt;class V = T& gt;
538- void return_value(V& amp;& amp; v);
539- ```
540-
541- @@ -33,4 +33,5 @@ void return_value(V& amp;& amp; v);
542-
543- ## 参照
544- - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html)
545- +- [LWG4345. `task::promise_type::return_value` default template parameter](https://cplusplus.github.io/LWG/issue4345)
546- - [LWG4346. `task::promise_type::return_void/value` lack a specification](https://cplusplus.github.io/LWG/issue4346)
547- < /code>< /pre> </summary >
548-
549- <author >
550- <name >yoh</name >
551- <email >kawasaki.liamg@gmail.com</email >
552- </author >
553- </entry >
554-
555725</feed >
0 commit comments