Skip to content

Commit 1f2e570

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 79e37ae commit 1f2e570

3 files changed

Lines changed: 43 additions & 187 deletions

File tree

lang/cpp26/reflection.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2026-04-30T06:36:25">
192-
2026年04月30日 06時36分25秒
191+
<span itemprop="datePublished" content="2026-05-14T07:51:06">
192+
2026年05月14日 07時51分06秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -392,6 +392,7 @@ <h2>スプライス演算子<code>[: :]</code></h2>
392392
</tr>
393393
</tbody>
394394
</table>
395+
<p>変数を表すリフレクションに対する式スプライスは、対応する式と同じ振る舞いをする。たとえば<a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Preconditions。関数呼び出し時に満たされていると関数が想定する条件。満たさなければ未定義の動作。契約属性の`[[expects]]`に相当">事前条件</a>式 (<code>pre</code>) や<a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Postconditions。関数を実行後に満たされている条件。契約属性の`[[ensures]]`に相当">事後条件</a>式 (<code>post</code>) の中の式は自動的に<code>const</code>修飾されるが、式スプライス<code>[:r:]</code>の結果も同様に<code>const</code>修飾される。</p>
395396
<p>メンバアクセスにもスプライスを使用できる。<code>obj.[:r:]</code>の形式で、リフレクション<code>r</code>が表すメンバ変数や基底クラスにアクセスする:</p>
396397
<p><div class="codehilite"><pre><span></span><code><span class="k">struct</span><span class="w"> </span><span class="nc">S</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">y</span><span class="p">;</span><span class="w"> </span><span class="p">};</span>
397398

@@ -719,6 +720,10 @@ <h2>参照</h2>
719720
<li>リフレクションのメタ関数のエラー処理として<code>std::meta::exception</code><a class="cpprefjp-defined-word" data-desc="問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態">例外</a>クラスを導入する。コンパイル時<a class="cpprefjp-defined-word" data-desc="問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態">例外</a>として動作する。</li>
720721
</ul>
721722
</li>
723+
<li><a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3598r0.pdf" target="_blank">P3598R0 CWG 3158 — <code>const</code>-ification of Splice Expressions</a><ul>
724+
<li>変数のリフレクションに対するスプライス式に対して、対応する<em>id-expression</em>と同様の文脈依存な型調整(<code>const</code>化など)を適用するよう仕様を修正する。</li>
725+
</ul>
726+
</li>
722727
</ul></div>
723728

724729
</div>

rss.xml

Lines changed: 35 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,43 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2026-05-14T07:37:15.529528</updated>
6-
<id>04f6c60d-6391-40a9-8739-ff3968ce5326</id>
5+
<updated>2026-05-14T07:56:01.648785</updated>
6+
<id>b0a260e9-86be-4cda-87e0-91640629b32f</id>
77

88

9+
<entry>
10+
<title>静的リフレクション [P2996R13] -- reflection: スプライス式でのconst化に対応 (close #1627)</title>
11+
<link href="https://cpprefjp.github.io/lang/cpp26/reflection.html"/>
12+
<id>f35a70ab27d2a38300c623b2d7889e2436387c5e:lang/cpp26/reflection.md</id>
13+
<updated>2026-05-14T16:51:06+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/lang/cpp26/reflection.md b/lang/cpp26/reflection.md
16+
index 9af5594cc..e49c50cf5 100644
17+
--- a/lang/cpp26/reflection.md
18+
+++ b/lang/cpp26/reflection.md
19+
@@ -134,6 +134,8 @@ constexpr std::meta::info rv = ^^value;
20+
| テンプレートスプライス | `template[:r:]` | リフレクション`r`が表すテンプレートを挿入 |
21+
| 名前空間スプライス | `namespace[:r:]` | リフレクション`r`が表す名前空間を挿入 |
22+
23+
+変数を表すリフレクションに対する式スプライスは、対応する式と同じ振る舞いをする。たとえば事前条件式 (`pre`) や事後条件式 (`post`) の中の式は自動的に`const`修飾されるが、式スプライス`[:r:]`の結果も同様に`const`修飾される。
24+
+
25+
メンバアクセスにもスプライスを使用できる。`obj.[:r:]`の形式で、リフレクション`r`が表すメンバ変数や基底クラスにアクセスする:
26+
27+
```cpp
28+
@@ -513,3 +515,5 @@ hash(o1) == hash(o3): false
29+
- コンパイル時に計算した値を静的ストレージに配置するための`define_static_string()`、`define_static_array()`、`define_static_object()`を追加する。
30+
- [P3560R2 Error Handling in Reflection](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3560r2.html)
31+
- リフレクションのメタ関数のエラー処理として`std::meta::exception`例外クラスを導入する。コンパイル時例外として動作する。
32+
+- [P3598R0 CWG 3158 — `const`-ification of Splice Expressions](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3598r0.pdf)
33+
+ - 変数のリフレクションに対するスプライス式に対して、対応する*id-expression*と同様の文脈依存な型調整(`const`化など)を適用するよう仕様を修正する。
34+
&lt;/code&gt;&lt;/pre&gt;</summary>
35+
36+
<author>
37+
<name>Akira Takahashi</name>
38+
<email>faithandbrave@gmail.com</email>
39+
</author>
40+
</entry>
41+
942
<entry>
1043
<title>コンパイラの実装状況 -- C++26 : 2026-05 mailingに対応 #1623</title>
1144
<link href="https://cpprefjp.github.io/implementation-status.html"/>
@@ -5502,186 +5535,4 @@ index 1ce0c6236..23c57da4a 100644
55025535
</author>
55035536
</entry>
55045537

5505-
<entry>
5506-
<title>parallel_scheduler -- execution/parallel_scheduler: P3804R2対応</title>
5507-
<link href="https://cpprefjp.github.io/reference/execution/execution/parallel_scheduler.html"/>
5508-
<id>3b295e47496c92b08c59a8ccb50ad418bfe20cfb:reference/execution/execution/parallel_scheduler.md</id>
5509-
<updated>2026-05-11T01:31:55+09:00</updated>
5510-
5511-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md
5512-
index b6f7f2361..8c0971575 100644
5513-
--- a/reference/execution/execution/parallel_scheduler.md
5514-
+++ b/reference/execution/execution/parallel_scheduler.md
5515-
@@ -42,11 +42,38 @@ namespace std::execution {
5516-
5517-
プロキシ`r`に対する事前確保バックエンドストレージ(preallocated backend storage)は、[`span`](/reference/span/span.md)`&amp;lt;`[`byte`](/reference/cstddef/byte.md)`&amp;gt;`型のオブジェクト`s`であり、`r`に対して[`set_value`](set_value.md)/[`set_error`](set_error.md)/[`set_stopped`](set_stopped.md)いずれかが呼び出されるまで範囲`s`は有効かつ上書き可能である。
5518-
5519-
-呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシ(bulk chunked proxy)は、基底
5520-
-[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`, `j`に対する`r.execute(i, j)`は`f(i, j, args...)`と同じ効果を持つ。
5521-
+式[`get_domain`](get_domain.md)`(sch)`は、下記と等価な説明専用の型`parallel-scheduler-domain`の式を返す。
5522-
5523-
-呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシ(bulk unchunked proxy)は、基底
5524-
-[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`に対する`r.execute(i, i + 1)`は`f(i, args...)`と同じ効果を持つ。
5525-
+```cpp
5526-
+struct parallel-scheduler-domain {
5527-
+ template&amp;lt;sender-for&amp;lt;bulk_chunked_t&amp;gt; Sndr, queryable Env&amp;gt;
5528-
+ static constexpr decltype(auto)
5529-
+ transform_sender(set_value_t, Sndr&amp;amp;&amp;amp; sndr, const Env&amp;amp; env) const noexcept {
5530-
+ return see below;
5531-
+ }
5532-
+ template&amp;lt;sender-for&amp;lt;bulk_unchunked_t&amp;gt; Sndr, queryable Env&amp;gt;
5533-
+ static constexpr decltype(auto)
5534-
+ transform_sender(set_value_t, Sndr&amp;amp;&amp;amp; sndr, const Env&amp;amp; env) const noexcept {
5535-
+ return see below;
5536-
+ }
5537-
+};
5538-
+```
5539-
+* sender-for[link sender-for.md]
5540-
+* queryable[link ../queryable.md]
5541-
+* set_value_t[link set_value.md]
5542-
+
5543-
+上記`transform_sender`の引数`sndr`に対して、説明用の変数`child`, `pol`, `shape`, `f`を下記の通り宣言する。
5544-
+
5545-
+```cpp
5546-
+auto&amp;amp; [_, data, child] = sndr;
5547-
+auto&amp;amp; [pol, shape, f] = data;
5548-
+```
5549-
+
5550-
+説明用の`p`を下記とする。
5551-
+
5552-
+- 式`pol`の型がCV修飾された[`parallel_policy`](execution_policy.md)または[`parallel_unsequenced_policy`](execution_policy.md)のとき、`true`。
5553-
+- `pol`が処理系定義の[実行ポリシー](execution_policy.md)のとき、処理系定義の値。
5554-
+- そうでなければ、`false`。
5555-
5556-
5557-
### `schedule`アルゴリズム
5558-
@@ -59,19 +86,19 @@ namespace std::execution {
5559-
5560-
5561-
### `bulk_chunked`アルゴリズム
5562-
-`parallel_scheduler`は[`bulk_chunked`](bulk_chunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_chunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、
5563-
+タグ`bulk_chunked`と[Sender](sender.md)を受け付ける`transform_sender`オーバーロードは、[Receiver](receiver.md)`rcvr`と[接続(connect)](connect.md)され結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、下記動作を行うSenderを返す。
5564-
5565-
-- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md)`(shape, r, s)`が呼ばれる。このとき、
5566-
- - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシであり、かつ
5567-
+- `child`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md)`(p ? shape : 1, r, s)`が呼ばれる。このとき、
5568-
+ - `r`は基底クラス[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシであり、インデックス`i`, `j`に対して`r.execute(i, j)`は`p`が`true`のとき`f(i, j, args...)`、そうでないときは`f(0, shape, args...)`と等価な効果を持つ。かつ
5569-
- `s`は`r`に対する事前確保バックエンドストレージである。
5570-
- 他の全ての完了操作は、変更なしに転送される。
5571-
5572-
5573-
### `bulk_unchunked`アルゴリズム
5574-
-`parallel_scheduler`は[`bulk_unchunked`](bulk_unchunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_unchunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、
5575-
+タグ`bulk_unchunked`と[Sender](sender.md)を受け付ける`transform_sender`オーバーロードは、[Receiver](receiver.md)`rcvr`と[接続(connect)](connect.md)され結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、下記動作を行うSenderを返す。
5576-
5577-
-- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md)`(shape, r, s)`が呼ばれる。このとき、
5578-
- - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシであり、かつ
5579-
+- `child`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md)`(p ? shape : 1, r, s)`が呼ばれる。このとき、
5580-
+ - `r`は基底クラス[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシであり、インデックス`i`に対して`r.execute(i, i + 1)`は`p`が`true`のとき`f(i, args...)`、そうでないときは`for (decltype(shape) i = 0; i &amp;lt; shape; i++) { f(i, args...); }`と等価な効果を持つ。かつ
5581-
- `s`は`r`に対する事前確保バックエンドストレージである。
5582-
- 他の全ての完了操作は、変更なしに転送される。
5583-
5584-
@@ -116,3 +143,4 @@ int main()
5585-
## 参照
5586-
- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html)
5587-
- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html)
5588-
+- [P3804R2 Iterating on `parallel_scheduler`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3804r2.html)
5589-
&lt;/code&gt;&lt;/pre&gt;</summary>
5590-
5591-
<author>
5592-
<name>yoh</name>
5593-
<email>kawasaki.liamg@gmail.com</email>
5594-
</author>
5595-
</entry>
5596-
5597-
<entry>
5598-
<title>receiver_proxy -- execution/parallel_scheduler: P3804R2対応</title>
5599-
<link href="https://cpprefjp.github.io/reference/execution/execution/system_context_replaceability/receiver_proxy.html"/>
5600-
<id>3b295e47496c92b08c59a8ccb50ad418bfe20cfb:reference/execution/execution/system_context_replaceability/receiver_proxy.md</id>
5601-
<updated>2026-05-11T01:31:55+09:00</updated>
5602-
5603-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/execution/execution/system_context_replaceability/receiver_proxy.md b/reference/execution/execution/system_context_replaceability/receiver_proxy.md
5604-
index 21ddce22f..e8e0debfc 100644
5605-
--- a/reference/execution/execution/system_context_replaceability/receiver_proxy.md
5606-
+++ b/reference/execution/execution/system_context_replaceability/receiver_proxy.md
5607-
@@ -18,7 +18,6 @@ namespace std::execution::system_context_replaceability {
5608-
5609-
| 名前 | 説明 | 対応バージョン |
5610-
|------|------|----------------|
5611-
-| `virtual ~receiver_proxy() = default;` | デストラクタ | C++26 |
5612-
| `virtual void set_value() noexcept = 0;` | 値完了ハンドラ | C++26 |
5613-
| `virtual void set_error(exception_ptr) noexcept = 0;` | エラー完了ハンドラ | C++26 |
5614-
| `virtual void set_stopped() noexcept = 0;` | 停止完了ハンドラ | C++26 |
5615-
@@ -42,3 +41,4 @@ namespace std::execution::system_context_replaceability {
5616-
5617-
## 参照
5618-
- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html)
5619-
+- [P3804R2 Iterating on `parallel_scheduler`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3804r2.html)
5620-
&lt;/code&gt;&lt;/pre&gt;</summary>
5621-
5622-
<author>
5623-
<name>yoh</name>
5624-
<email>kawasaki.liamg@gmail.com</email>
5625-
</author>
5626-
</entry>
5627-
5628-
<entry>
5629-
<title>try_query -- execution/parallel_scheduler: P3804R2対応</title>
5630-
<link href="https://cpprefjp.github.io/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.html"/>
5631-
<id>3b295e47496c92b08c59a8ccb50ad418bfe20cfb:reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md</id>
5632-
<updated>2026-05-11T01:31:55+09:00</updated>
5633-
5634-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md
5635-
index e12337398..717145e39 100644
5636-
--- a/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md
5637-
+++ b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md
5638-
@@ -7,7 +7,7 @@
5639-
5640-
```cpp
5641-
template&amp;lt;class P, class-type Query&amp;gt;
5642-
-optional&amp;lt;P&amp;gt; try_query(Query q) noexcept;
5643-
+optional&amp;lt;P&amp;gt; try_query(Query q) const noexcept;
5644-
```
5645-
* class-type[link ../../../class-type.md]
5646-
* optional[link /reference/optional/optional.md]
5647-
@@ -22,11 +22,13 @@ optional&amp;lt;P&amp;gt; try_query(Query q) noexcept;
5648-
5649-
## 戻り値
5650-
説明用の`env`を`*this`が表現する[Receiver](../../receiver.md)の環境とする。
5651-
-下記を満たす場合は[`nullopt`](/reference/optional/nullopt_t.md)を返す。そうでなければ、`q(env)`を返す。
5652-
+下記を満たす場合は[`nullopt`](/reference/optional/nullopt_t.md)を返す。
5653-
5654-
- `Query`が実装定義でサポートされるクエリ集合のメンバではない、または
5655-
- `P`が実装定義でサポートされる`Query`の結果型集合のメンバではない、または
5656-
-- 式`q(env)`が適格でないか、cv修飾された`P`型を持たない。
5657-
+- 式`q(env)`が適格でない。
5658-
+
5659-
+そうではなく、`q(env)`がCV修飾された`P`型を持つときは`q(env)`を返す。そうでなければ、[`optional`](/reference/optional/optional.md)`&amp;lt;P&amp;gt;`型の実装定義の値を返す。
5660-
5661-
5662-
## 例外
5663-
@@ -34,7 +36,9 @@ optional&amp;lt;P&amp;gt; try_query(Query q) noexcept;
5664-
5665-
5666-
## 備考
5667-
-[`get_stop_token_t`](../../../get_stop_token.md)は実装定義でサポートるクエリ集合に含まれ、[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)は`get_stop_token_t`の実装定義でサポートされる結果型集合のメンバである。
5668-
+[`get_stop_token_t`](../../../get_stop_token.md)は実装定義でサポートするクエリ集合に含まれ、[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)は`get_stop_token_t`の実装定義でサポートされる結果型集合のメンバである。
5669-
+
5670-
+推奨実装:`P`が[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)であり型`T`が[`stoppable_token`](/reference/stop_token/stoppable_token.md)をモデル化する`inplace_stop_token`以外の型である場合、`try_query`は、`*this`に対して`set_value`/`set_error`/`set_stopped`のいずれかが呼び出されるまで全ての`try_query`呼び出しが`inplace_stop_token`オブジェクトと等価なオブジェクトを返す、`inplace_stop_token`型のオブジェクトを返すべき。
5671-
5672-
5673-
## バージョン
5674-
@@ -55,3 +59,4 @@ optional&amp;lt;P&amp;gt; try_query(Query q) noexcept;
5675-
5676-
## 参照
5677-
- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html)
5678-
+- [P3804R2 Iterating on `parallel_scheduler`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3804r2.html)
5679-
&lt;/code&gt;&lt;/pre&gt;</summary>
5680-
5681-
<author>
5682-
<name>yoh</name>
5683-
<email>kawasaki.liamg@gmail.com</email>
5684-
</author>
5685-
</entry>
5686-
56875538
</feed>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44390,7 +44390,7 @@
4439044390

4439144391
<url>
4439244392
<loc>https://cpprefjp.github.io/lang/cpp26/reflection.html</loc>
44393-
<lastmod>2026-05-09T08:29:16+09:00</lastmod>
44393+
<lastmod>2026-05-14T16:51:06+09:00</lastmod>
4439444394
<changefreq>daily</changefreq>
4439544395
<priority>0.7</priority>
4439644396
</url>

0 commit comments

Comments
 (0)