Skip to content

Commit f5752c3

Browse files
committed
抜け漏れ修正
1 parent 2a61834 commit f5752c3

106 files changed

Lines changed: 4250 additions & 36 deletions

File tree

Some content is hidden

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

lang/cpp26/reflection.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,35 @@ constexpr auto r4 = ^^std::vector; // テンプレートのリフレクショ
7575
| 基底クラス関係 | [`bases_of()`](/reference/meta/bases_of.md)経由 | 基底クラスの型、アクセス指定子、`virtual`の有無 |
7676
| 関数パラメータ | [`parameters_of()`](/reference/meta/parameters_of.md)経由 | 名前、型、デフォルト引数の有無、明示的オブジェクトパラメータか |
7777

78+
### オーバーロードされた関数のリフレクション
79+
`^^f`で関数`f`をリフレクションする場合、`f`がオーバーロードされていると不適格となる。`^^`はオーバーロード集合ではなく単一の関数を対象とする。
80+
81+
```cpp
82+
void f(int);
83+
void f(double);
84+
85+
// constexpr auto r = ^^f; // エラー: fはオーバーロードされている
86+
```
87+
88+
オーバーロードされた関数の個々のオーバーロードを取得するには、[`members_of()`](/reference/meta/members_of.md)を使用する。`members_of()`は各オーバーロードを個別のリフレクションとして返す。
89+
90+
```cpp
91+
struct S {
92+
void f(int);
93+
void f(double);
94+
};
95+
96+
// members_of()で個々のオーバーロードを取得
97+
constexpr auto members = std::meta::members_of(
98+
^^S, std::meta::access_context::unchecked());
99+
// フィルタリングで特定のオーバーロードを選択できる
100+
```
101+
* std::meta::members_of[link /reference/meta/members_of.md]
102+
* std::meta::access_context[link /reference/meta/access_context.md]
103+
* unchecked[link /reference/meta/access_context/unchecked.md]
104+
105+
また、スプライスで関数のリフレクションを式に変換する場合、オーバーロード解決は行われず、そのリフレクションが表す特定の関数が直接使用される。
106+
78107

79108
## スプライス演算子`[: :]`
80109
スプライス演算子は、[`std::meta::info`](/reference/meta/info.md)型の値(リフレクション)を受け取り、それが表すプログラム要素(型、式、テンプレート、名前空間)に変換して挿入する。`[:``:]`の間には`std::meta::info`型に評価される式を記述する。

reference/meta.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
| [`is_protected`](meta/is_protected.md) | `protected`であるか | C++26 |
7171
| [`is_private`](meta/is_private.md) | `private`であるか | C++26 |
7272
| [`is_accessible`](meta/is_accessible.md) | 指定したアクセスコンテキストでアクセス可能か | C++26 |
73+
| [`has_inaccessible_nonstatic_data_members`](meta/has_inaccessible_nonstatic_data_members.md) | アクセス不可能な非静的データメンバがあるか | C++26 |
74+
| [`has_inaccessible_bases`](meta/has_inaccessible_bases.md) | アクセス不可能な基底クラスがあるか | C++26 |
7375

7476

7577
## エンティティの分類
@@ -92,6 +94,18 @@
9294
| [`is_static_member`](meta/is_static_member.md) | 静的メンバであるか | C++26 |
9395
| [`is_base`](meta/is_base.md) | 基底クラス関係であるか | C++26 |
9496
| [`is_function_parameter`](meta/is_function_parameter.md) | 関数パラメータであるか | C++26 |
97+
| [`is_template`](meta/is_template.md) | テンプレートであるか | C++26 |
98+
| [`is_function_template`](meta/is_function_template.md) | 関数テンプレートであるか | C++26 |
99+
| [`is_variable_template`](meta/is_variable_template.md) | 変数テンプレートであるか | C++26 |
100+
| [`is_class_template`](meta/is_class_template.md) | クラステンプレートであるか | C++26 |
101+
| [`is_alias_template`](meta/is_alias_template.md) | エイリアステンプレートであるか | C++26 |
102+
| [`is_conversion_function_template`](meta/is_conversion_function_template.md) | 変換関数テンプレートであるか | C++26 |
103+
| [`is_operator_function_template`](meta/is_operator_function_template.md) | 演算子関数テンプレートであるか | C++26 |
104+
| [`is_literal_operator_template`](meta/is_literal_operator_template.md) | リテラル演算子テンプレートであるか | C++26 |
105+
| [`is_constructor_template`](meta/is_constructor_template.md) | コンストラクタテンプレートであるか | C++26 |
106+
| [`is_concept`](meta/is_concept.md) | コンセプトであるか | C++26 |
107+
| [`is_complete_type`](meta/is_complete_type.md) | 完全型であるか | C++26 |
108+
| [`is_enumerable_type`](meta/is_enumerable_type.md) | 列挙可能型であるか | C++26 |
95109

96110

97111
## 関数の分類
@@ -285,7 +299,69 @@
285299
| [`is_bounded_array_type`](meta/is_bounded_array_type.md) | 境界付き配列型か | C++26 |
286300
| [`is_unbounded_array_type`](meta/is_unbounded_array_type.md) | 境界なし配列型か | C++26 |
287301
| [`is_scoped_enum_type`](meta/is_scoped_enum_type.md) | スコープ付き列挙型か | C++26 |
302+
| [`is_constructible_type`](meta/is_constructible_type.md) | 構築可能型か | C++26 |
303+
| [`is_default_constructible_type`](meta/is_default_constructible_type.md) | デフォルト構築可能型か | C++26 |
304+
| [`is_copy_constructible_type`](meta/is_copy_constructible_type.md) | コピー構築可能型か | C++26 |
305+
| [`is_move_constructible_type`](meta/is_move_constructible_type.md) | ムーブ構築可能型か | C++26 |
306+
| [`is_assignable_type`](meta/is_assignable_type.md) | 代入可能型か | C++26 |
307+
| [`is_copy_assignable_type`](meta/is_copy_assignable_type.md) | コピー代入可能型か | C++26 |
308+
| [`is_move_assignable_type`](meta/is_move_assignable_type.md) | ムーブ代入可能型か | C++26 |
309+
| [`is_swappable_with_type`](meta/is_swappable_with_type.md) | 指定型とのswap可能型か | C++26 |
310+
| [`is_swappable_type`](meta/is_swappable_type.md) | swap可能型か | C++26 |
311+
| [`is_destructible_type`](meta/is_destructible_type.md) | 破棄可能型か | C++26 |
312+
| [`is_trivially_constructible_type`](meta/is_trivially_constructible_type.md) | トリビアルに構築可能型か | C++26 |
313+
| [`is_trivially_default_constructible_type`](meta/is_trivially_default_constructible_type.md) | トリビアルにデフォルト構築可能型か | C++26 |
314+
| [`is_trivially_copy_constructible_type`](meta/is_trivially_copy_constructible_type.md) | トリビアルにコピー構築可能型か | C++26 |
315+
| [`is_trivially_move_constructible_type`](meta/is_trivially_move_constructible_type.md) | トリビアルにムーブ構築可能型か | C++26 |
316+
| [`is_trivially_assignable_type`](meta/is_trivially_assignable_type.md) | トリビアルに代入可能型か | C++26 |
317+
| [`is_trivially_copy_assignable_type`](meta/is_trivially_copy_assignable_type.md) | トリビアルにコピー代入可能型か | C++26 |
318+
| [`is_trivially_move_assignable_type`](meta/is_trivially_move_assignable_type.md) | トリビアルにムーブ代入可能型か | C++26 |
319+
| [`is_trivially_destructible_type`](meta/is_trivially_destructible_type.md) | トリビアルに破棄可能型か | C++26 |
320+
| [`is_nothrow_constructible_type`](meta/is_nothrow_constructible_type.md) | 例外を送出せずに構築可能型か | C++26 |
321+
| [`is_nothrow_default_constructible_type`](meta/is_nothrow_default_constructible_type.md) | 例外を送出せずにデフォルト構築可能型か | C++26 |
322+
| [`is_nothrow_copy_constructible_type`](meta/is_nothrow_copy_constructible_type.md) | 例外を送出せずにコピー構築可能型か | C++26 |
323+
| [`is_nothrow_move_constructible_type`](meta/is_nothrow_move_constructible_type.md) | 例外を送出せずにムーブ構築可能型か | C++26 |
324+
| [`is_nothrow_assignable_type`](meta/is_nothrow_assignable_type.md) | 例外を送出せずに代入可能型か | C++26 |
325+
| [`is_nothrow_copy_assignable_type`](meta/is_nothrow_copy_assignable_type.md) | 例外を送出せずにコピー代入可能型か | C++26 |
326+
| [`is_nothrow_move_assignable_type`](meta/is_nothrow_move_assignable_type.md) | 例外を送出せずにムーブ代入可能型か | C++26 |
327+
| [`is_nothrow_swappable_with_type`](meta/is_nothrow_swappable_with_type.md) | 例外を送出せずに指定型とswap可能型か | C++26 |
328+
| [`is_nothrow_swappable_type`](meta/is_nothrow_swappable_type.md) | 例外を送出せずにswap可能型か | C++26 |
329+
| [`is_nothrow_destructible_type`](meta/is_nothrow_destructible_type.md) | 例外を送出せずに破棄可能型か | C++26 |
330+
| [`is_trivially_relocatable_type`](meta/is_trivially_relocatable_type.md) | トリビアルにリロケート可能型か | C++26 |
331+
| [`is_nothrow_relocatable_type`](meta/is_nothrow_relocatable_type.md) | 例外を送出せずにリロケート可能型か | C++26 |
332+
| [`is_replaceable_type`](meta/is_replaceable_type.md) | 置換可能型か | C++26 |
333+
| [`is_consteval_only_type`](meta/is_consteval_only_type.md) | consteval-only型か | C++26 |
334+
| [`is_implicit_lifetime_type`](meta/is_implicit_lifetime_type.md) | 暗黙の生存期間型か | C++26 |
335+
| [`has_virtual_destructor`](meta/has_virtual_destructor.md) | 仮想デストラクタを持つか | C++26 |
336+
| [`has_unique_object_representations`](meta/has_unique_object_representations.md) | 一意なオブジェクト表現を持つか | C++26 |
337+
| [`reference_constructs_from_temporary`](meta/reference_constructs_from_temporary.md) | 参照が一時オブジェクトから構築されるか | C++26 |
338+
| [`reference_converts_from_temporary`](meta/reference_converts_from_temporary.md) | 参照への変換が一時オブジェクトを経由するか | C++26 |
339+
340+
341+
342+
## 型特性(型プロパティクエリ)
288343

344+
| 名前 | 説明 | 対応バージョン |
345+
|------|------|-------|
346+
| [`rank`](meta/rank.md) | 配列型の次元数を取得 | C++26 |
347+
| [`extent`](meta/extent.md) | 配列型の指定次元の要素数を取得 | C++26 |
348+
349+
350+
## 型特性(型の関係)
351+
352+
| 名前 | 説明 | 対応バージョン |
353+
|------|------|-------|
354+
| [`is_same_type`](meta/is_same_type.md) | 同じ型か | C++26 |
355+
| [`is_base_of_type`](meta/is_base_of_type.md) | 基底クラスであるか | C++26 |
356+
| [`is_virtual_base_of_type`](meta/is_virtual_base_of_type.md) | 仮想基底クラスであるか | C++26 |
357+
| [`is_convertible_type`](meta/is_convertible_type.md) | 変換可能か | C++26 |
358+
| [`is_nothrow_convertible_type`](meta/is_nothrow_convertible_type.md) | 例外を送出せずに変換可能か | C++26 |
359+
| [`is_layout_compatible_type`](meta/is_layout_compatible_type.md) | レイアウト互換か | C++26 |
360+
| [`is_pointer_interconvertible_base_of_type`](meta/is_pointer_interconvertible_base_of_type.md) | ポインタ相互変換可能な基底クラスか | C++26 |
361+
| [`is_invocable_type`](meta/is_invocable_type.md) | 呼び出し可能か | C++26 |
362+
| [`is_invocable_r_type`](meta/is_invocable_r_type.md) | 指定戻り値型で呼び出し可能か | C++26 |
363+
| [`is_nothrow_invocable_type`](meta/is_nothrow_invocable_type.md) | 例外を送出せずに呼び出し可能か | C++26 |
364+
| [`is_nothrow_invocable_r_type`](meta/is_nothrow_invocable_r_type.md) | 例外を送出せずに指定戻り値型で呼び出し可能か | C++26 |
289365

290366
## 型変換
291367

@@ -314,6 +390,10 @@
314390
| [`invoke_result`](meta/invoke_result.md) | 呼び出し結果型を取得 | C++26 |
315391
| [`unwrap_reference`](meta/unwrap_reference.md) | `reference_wrapper`を展開 | C++26 |
316392
| [`unwrap_ref_decay`](meta/unwrap_ref_decay.md) | `decay`後に`reference_wrapper`を展開 | C++26 |
393+
| [`tuple_size`](meta/tuple_size.md) | tuple-like型の要素数を取得 | C++26 |
394+
| [`tuple_element`](meta/tuple_element.md) | tuple-like型の要素型を取得 | C++26 |
395+
| [`variant_size`](meta/variant_size.md) | variant型の候補型の数を取得 | C++26 |
396+
| [`variant_alternative`](meta/variant_alternative.md) | variant型の候補型を取得 | C++26 |
317397
| [`type_order`](meta/type_order.md) | 型の順序を取得 | C++26 |
318398

319399

reference/meta/extent.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# extent
2+
* meta[meta header]
3+
* std::meta[meta namespace]
4+
* function[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::meta {
9+
consteval std::size_t extent(info type, unsigned int i = 0);
10+
}
11+
```
12+
* info[link info.md]
13+
14+
## 概要
15+
配列型の指定次元の要素数を取得する。[`std::extent`](/reference/type_traits/extent.md)に対応する。
16+
17+
18+
## 戻り値
19+
`type`が表す型に対して、`i`番目の次元の[`std::extent`](/reference/type_traits/extent.md)相当の値を返す。
20+
21+
22+
## 例外
23+
`type`が型を表さない場合、[`std::meta::exception`](exception.md)例外を送出する。
24+
25+
26+
## 例
27+
```cpp example
28+
#include <meta>
29+
30+
int main() {
31+
static_assert(std::meta::extent(^^int[3][4], 0) == 3);
32+
static_assert(std::meta::extent(^^int[3][4], 1) == 4);
33+
static_assert(std::meta::extent(^^int[3]) == 3);
34+
}
35+
```
36+
* std::meta::extent[color ff0000]
37+
38+
### 出力
39+
```
40+
```
41+
42+
## バージョン
43+
### 言語
44+
- C++26
45+
46+
### 処理系
47+
- [Clang](/implementation.md#clang): ??
48+
- [GCC](/implementation.md#gcc): ??
49+
- [Visual C++](/implementation.md#visual_cpp): ??
50+
51+
52+
## 関連項目
53+
- [`rank`](rank.md)
54+
- [`std::extent`](/reference/type_traits/extent.md)
55+
56+
57+
## 参照
58+
- [P2996R13 Reflection for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r13.html)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# has_inaccessible_bases
2+
* meta[meta header]
3+
* std::meta[meta namespace]
4+
* function[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::meta {
9+
consteval bool has_inaccessible_bases(info r, access_context ctx);
10+
}
11+
```
12+
* info[link info.md]
13+
* access_context[link access_context.md]
14+
15+
## 概要
16+
クラスにアクセス不可能な基底クラスがあるかを判定する。
17+
18+
19+
## 戻り値
20+
指定したアクセスコンテキストでアクセスできない基底クラスが存在する場合に`true`を返す。
21+
22+
23+
## 例
24+
```cpp example
25+
#include <meta>
26+
27+
class C {
28+
int secret;
29+
public:
30+
int visible;
31+
};
32+
33+
int main() {
34+
constexpr auto ctx = std::meta::access_context::unprivileged();
35+
static_assert(std::meta::has_inaccessible_bases(^^C, ctx));
36+
}
37+
```
38+
* std::meta::access_context[link access_context.md]
39+
* unprivileged[link access_context/unprivileged.md]
40+
41+
### 出力
42+
```
43+
```
44+
45+
46+
## バージョン
47+
### 言語
48+
- C++26
49+
50+
### 処理系
51+
- [Clang](/implementation.md#clang): ??
52+
- [GCC](/implementation.md#gcc): ??
53+
- [Visual C++](/implementation.md#visual_cpp): ??
54+
55+
56+
## 参照
57+
- [P2996R13 Reflection for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r13.html)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# has_inaccessible_nonstatic_data_members
2+
* meta[meta header]
3+
* std::meta[meta namespace]
4+
* function[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::meta {
9+
consteval bool has_inaccessible_nonstatic_data_members(info r, access_context ctx);
10+
}
11+
```
12+
* info[link info.md]
13+
* access_context[link access_context.md]
14+
15+
## 概要
16+
クラスにアクセス不可能な非静的データメンバがあるかを判定する。
17+
18+
19+
## 戻り値
20+
指定したアクセスコンテキストでアクセスできない非静的データメンバが存在する場合に`true`を返す。
21+
22+
23+
## 例
24+
```cpp example
25+
#include <meta>
26+
27+
class C {
28+
int secret;
29+
public:
30+
int visible;
31+
};
32+
33+
int main() {
34+
constexpr auto ctx = std::meta::access_context::unprivileged();
35+
static_assert(std::meta::has_inaccessible_nonstatic_data_members(^^C, ctx));
36+
}
37+
```
38+
* std::meta::access_context[link access_context.md]
39+
* unprivileged[link access_context/unprivileged.md]
40+
41+
### 出力
42+
```
43+
```
44+
45+
46+
## バージョン
47+
### 言語
48+
- C++26
49+
50+
### 処理系
51+
- [Clang](/implementation.md#clang): ??
52+
- [GCC](/implementation.md#gcc): ??
53+
- [Visual C++](/implementation.md#visual_cpp): ??
54+
55+
56+
## 参照
57+
- [P2996R13 Reflection for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r13.html)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# has_unique_object_representations
2+
* meta[meta header]
3+
* std::meta[meta namespace]
4+
* function[meta id-type]
5+
* cpp26[meta cpp]
6+
7+
```cpp
8+
namespace std::meta {
9+
consteval bool has_unique_object_representations(info type);
10+
}
11+
```
12+
* info[link info.md]
13+
14+
## 概要
15+
型が一意なオブジェクト表現を持つかを判定する。[`std::has_unique_object_representations`](/reference/type_traits/has_unique_object_representations.md)に対応する。
16+
17+
18+
## 戻り値
19+
`type`が表す型が一意なオブジェクト表現を持つ場合に`true`を返す。
20+
21+
22+
## 例外
23+
`type`が型を表さない場合、[`std::meta::exception`](exception.md)例外を送出する。
24+
25+
26+
## 例
27+
```cpp example
28+
#include <meta>
29+
30+
int main() {
31+
static_assert(std::meta::has_unique_object_representations(^^int));
32+
}
33+
```
34+
35+
### 出力
36+
```
37+
```
38+
39+
40+
## バージョン
41+
### 言語
42+
- C++26
43+
44+
### 処理系
45+
- [Clang](/implementation.md#clang): ??
46+
- [GCC](/implementation.md#gcc): ??
47+
- [Visual C++](/implementation.md#visual_cpp): ??
48+
49+
50+
## 関連項目
51+
- [`std::has_unique_object_representations`](/reference/type_traits/has_unique_object_representations.md)
52+
53+
54+
## 参照
55+
- [P2996R13 Reflection for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r13.html)

0 commit comments

Comments
 (0)