Skip to content

Commit 2a61834

Browse files
committed
C++26リフレクションに対応 #1493
1 parent c8f0f3f commit 2a61834

File tree

193 files changed

+11186
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+11186
-7
lines changed

.github/workflows/script/ngword_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
("", "voaltile", "volatile"),
5151
("", "Updated upstream", ""),
5252
("", "Stashed changes", ""),
53+
("", "アラインメント", "アライメント"),
5354
("", "イテレーター", "イテレータ"),
5455
("", "子ルーチン", "コルーチン"),
5556
("", "移譲", "委譲"),

GLOBAL_DEFINED_WORDS.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,17 @@
209209
"ダングリング": {
210210
"yomi": "だんぐりんぐ",
211211
"desc": "dangling。寿命が尽きた無効なオブジェクトやメモリ領域を、ポインタ・参照・イテレータなどが指し続けている状態のこと。これらにアクセスすると未定義の動作を引き起こす"
212+
},
213+
"構造的型": {
214+
"yomi": "こうぞうてきかた",
215+
"desc": "structural type。定数テンプレートパラメータとして使用できる型の条件。スカラ型、左辺値参照型、すべての基底クラスと非静的データメンバがpublicかつmutableでなく構造的型であるリテラルクラス型、および同様の条件を満たす配列型が該当する"
216+
},
217+
"定数テンプレートパラメータ": {
218+
"yomi": "ていすうてんぷれーとぱらめーた",
219+
"desc": "constant template parameter。テンプレートパラメータのうち、型ではなく値をとるもの。C++23以前は「非型テンプレートパラメータ (non-type template parameter)」と呼ばれていた"
220+
},
221+
"非型テンプレートパラメータ": {
222+
"yomi": "ひかたてんぷれーとぱらめーた",
223+
"redirect": "定数テンプレートパラメータ"
212224
}
213225
}

GLOBAL_QUALIFY_LIST.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@
232232
* std::unique_ptr[link /reference/memory/unique_ptr.md]
233233
* addressof[link /reference/memory/addressof.md]
234234
* <memory_resource>[link /reference/memory_resource.md]
235+
* <meta>[link /reference/meta.md]
236+
* std::meta::info[link /reference/meta/info.md]
235237
* <mutex>[link /reference/mutex.md]
236238
* std::lock_guard[link /reference/mutex/lock_guard.md]
237239
* std::mutex[link /reference/mutex/mutex.md]
@@ -302,6 +304,7 @@
302304
* std::set[link /reference/set/set.md]
303305
* <shared_mutex>[link /reference/shared_mutex.md]
304306
* <source_location>[link /reference/source_location.md]
307+
* std::source_location[link /reference/source_location/source_location.md]
305308
* <span>[link /reference/span.md]
306309
* std::dynamic_extent[link /reference/span/dynamic_extent.md]
307310
* std::span[link /reference/span/span.md]

implementation-status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
| P2841R7: [コンセプトと変数テンプレートをテンプレート引数として渡せるようにする](/lang/cpp26/concept_and_variable-template_template-parameters.md) | テンプレートテンプレートパラメータとして、クラステンプレートやエイリアステンプレートに加え、コンセプトと変数テンプレートも渡せるようにする | | | | |
327327
| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | |
328328
| P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | |
329-
| P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^``std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | |
329+
| P2996R13: [静的リフレクション](/lang/cpp26/reflection.md) | リフレクション演算子`^^``std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | |
330330
| P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`](/lang/cpp26/expansion_statements.md) | タプル・構造体・Range・パラメータパックなどの各要素に対してコンパイル時に文を展開する`template for`文を追加 | 16 | | | |
331331
| P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) | 定数式の文脈での仮想継承を許可 | 16 | | | |
332332
| P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | |

lang/cpp11/attributes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ C++11で採用されたもの以外で検討された以下の機能は、属性
180180
- [C++23 コード内容の仮定をコンパイラに伝える`assume`属性](/lang/cpp23/portable_assumptions.md)
181181
- [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md)
182182
- [C++26 未初期化変数の読み取りをエラー性動作とする (`[[indeterminate]]`属性)](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md)
183+
- [C++26 静的リフレクション](/lang/cpp26/reflection.md)
184+
- 属性と同じ`[[`...`]]`構文を用いたアノテーション機能`[[=expr]]`が導入される。属性はコンパイラへのヒントだが、アノテーションはリフレクションで取得可能なユーザー定義のメタデータである
183185
184186
185187
## 参照

lang/cpp20/immediate_functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評
111111
* [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](constinit.md)
112112
* [C++23 `if consteval`](/lang/cpp23/if_consteval.md)
113113
* [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md)
114+
* [C++26 静的リフレクション](/lang/cpp26/reflection.md)
115+
* `consteval { ... }`ブロック構文が導入され、コンパイル時に副作用のあるコードを実行できるようになる
114116

115117
## 参照
116118

lang/cpp26.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通
7474

7575
| 言語機能 | 説明 |
7676
|----------|------|
77-
| [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^``std::meta::info`型によりコンパイル時にさまざまな情報を取得できる |
77+
| [静的リフレクション](/lang/cpp26/reflection.md) | リフレクション演算子`^^``std::meta::info`型によりコンパイル時にさまざまな情報を取得できる |
7878
| [コンパイル時のタプルやリストを展開処理する`template for`](/lang/cpp26/expansion_statements.md) | タプル・構造体・Range・パラメータパックなどの各要素に対してコンパイル時に文を展開する`template for`文を追加 |
7979
| [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する |
8080
| [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr``S.size()``S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする |

lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ const auto d = hello("Adolph Blaine Charles David Earl Frederick Gerald Hubert I
5656
- [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)
5757
- [`<stdexcept>`](/reference/stdexcept.md)
5858
- [`std::bad_expected_access`](/reference/expected/bad_expected_access.md)
59+
- [C++26 静的リフレクション](/lang/cpp26/reflection.md)
60+
- リフレクションのメタ関数が不正な入力を受けた際のエラー報告として、コンパイル時の例外送出が使われる
5961
6062
6163
## 参照

lang/cpp26/expansion_statements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ C++23以前では、[`std::tuple`](/reference/tuple/tuple.md)のような異種
192192
- [C++17 畳み込み式](/lang/cpp17/folding_expressions.md)
193193
- [C++17 構造化束縛](/lang/cpp17/structured_bindings.md)
194194
- [C++26 構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md)
195-
- [C++26 静的リフレクション](/lang/cpp26/reflection.md.nolink)
195+
- [C++26 静的リフレクション](/lang/cpp26/reflection.md)
196196
- [`std::tuple`](/reference/tuple/tuple.md)
197197
- [`std::apply()`](/reference/tuple/apply.md)
198198

lang/cpp26/feature_test_macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
|`__cpp_contracts`|`202502L`|[契約プログラミングをサポートする](/lang/cpp26/contracts.md)|
2222
|`__cpp_deleted_function`|`202403L`|[関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md)|
2323
|`__cpp_expansion_statements`|`202506L`|[コンパイル時のタプルやリストを展開処理する`template for`](/lang/cpp26/expansion_statements.md)|
24-
|`__cpp_impl_reflection`|`202506L`|静的リフレクション|
24+
|`__cpp_impl_reflection`|`202506L`|[静的リフレクション](/lang/cpp26/reflection.md)|
2525
|`__cpp_pack_indexing`|`202311L`|[パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md)|
2626
|`__cpp_placeholder_variables`|`202306L`|[宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md)|
2727
|`__cpp_pp_embed`|`202502L`|[ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md)|
@@ -75,7 +75,7 @@
7575
|`__cpp_lib_copyable_function`|`202306L`|[`<functional>`](/reference/functional.md)[`std::copyable_function`](/reference/functional/copyable_function.md)を追加|[`<functional>`](/reference/functional.md)|
7676
|`__cpp_lib_counting_scope`|`202506L`|[`<execution>`](/reference/execution.md)[`std::execution::spawn`](/reference/execution/execution/spawn.md)[`std::execution::scope_token`](/reference/execution/execution/scope_token.md)などを追加|[`<execution>`](/reference/execution.md)|
7777
|`__cpp_lib_debugging`|`202403L`|デバッグサポートのライブラリとして[`<debugging>`](/reference/debugging.md)を追加|[`<debugging>`](/reference/debugging.md)|
78-
|`__cpp_lib_define_static`|`202506L`||[`<meta>`](/reference/meta.md.nolink)|
78+
|`__cpp_lib_define_static`|`202506L`||[`<meta>`](/reference/meta.md)|
7979
|`__cpp_lib_exception_ptr_cast`|`202506L`|[`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md)関数を追加|[`<exception>`](/reference/exception.md)|
8080
|`__cpp_lib_format`|`202311L`||[`<format>`](/reference/format.md)|
8181
|`__cpp_lib_format_path`|`202506L`|[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、文字列フォーマットのサポートを追加<br/>[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、出力用の文字列を取得するためのメンバ関数を追加|[`<filesystem>`](/reference/filesystem.md)|
@@ -138,7 +138,7 @@
138138
|`__cpp_lib_raw_memory_algorithms`|`202411L`|[`std::uninitialized_default_construct()`](/reference/memory/uninitialized_default_construct.md)などの未初期化領域に対する操作を`constexpr`対応|[`<memory>`](/reference/memory.md)|
139139
|`__cpp_lib_rcu`|`202306L`|RCU (Read Copy Update) のライブラリとして[`<rcu>`](/reference/rcu.md)を追加|[`<rcu>`](/reference/rcu.md)|
140140
|`__cpp_lib_reference_wrapper`|`202403L`|[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md)[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md)を追加|[`<functional>`](/reference/functional.md)|
141-
|`__cpp_lib_reflection`|`202506L`||[`<meta>`](/reference/meta.md.nolink)|
141+
|`__cpp_lib_reflection`|`202506L`|[静的リフレクション](/lang/cpp26/reflection.md)のライブラリ機能|[`<meta>`](/reference/meta.md)|
142142
|`__cpp_lib_saturation_arithmetic`|`202311L`|[`<numeric>`](/reference/numeric.md)に飽和演算 (Saturation Arithmetic) として[`std::add_sat()`](/reference/numeric/add_sat.md)などの関数を追加|[`<numeric>`](/reference/numeric.md)|
143143
|`__cpp_lib_senders`|`202506L`||[`<execution>`](/reference/execution.md)|
144144
|`__cpp_lib_simd`|`202506L`|データ並列ライブラリとして、[`<simd>`](/reference/simd.md.nolink)を追加|[`<simd>`](/reference/simd.md.nolink)|

0 commit comments

Comments
 (0)