最終更新日時(UTC):
が更新

履歴 編集

<meta>

meta(C++26)

<meta>ヘッダでは、静的リフレクションのためのメタ関数群を定義する。リフレクション演算子^^で取得したstd::meta::info型の値を操作・検査するための機能を提供する。

このヘッダのすべての関数はconstevalであり、コンパイル時にのみ使用できる。

リフレクション型

名前 説明 対応バージョン
info リフレクションを表す型 (using info = decltype(^^::);) C++26

コンセプト

名前 説明 対応バージョン
reflection_range 要素型がinfoであるRange (concept) C++26

アクセス制御

名前 説明 対応バージョン
access_context メンバ取得時のアクセス制御コンテキスト (class) C++26

演算子

名前 説明 対応バージョン
operators 演算子の種類を表す列挙型 (enum class) C++26
operator_of 演算子のリフレクションから演算子の種類を取得 C++26
symbol_of 演算子の種類から記号文字列を取得 C++26
u8symbol_of 演算子の種類から記号文字列をu8string_viewで取得 C++26

名前とソース位置

名前 説明 対応バージョン
has_identifier 識別子を持つかどうかを判定 C++26
identifier_of 識別子をstring_viewで取得 C++26
u8identifier_of 識別子をu8string_viewで取得 C++26
display_string_of 表示用の文字列をstring_viewで取得 C++26
u8display_string_of 表示用の文字列をu8string_viewで取得 C++26
source_location_of ソース位置を取得 C++26

現在のスコープ

名前 説明 対応バージョン
current_function 呼び出し時点で囲んでいる関数のリフレクションを取得 C++26
current_class 呼び出し時点で囲んでいるクラスのリフレクションを取得 C++26
current_namespace 呼び出し時点で囲んでいる名前空間のリフレクションを取得 C++26

エンティティの性質

名前 説明 対応バージョン
type_of 型のリフレクションを取得 C++26
object_of オブジェクトのリフレクションを取得 C++26
constant_of 定数のリフレクションを取得 C++26
dealias エイリアスを解決する C++26
has_parent 親スコープがあるかどうかを判定 C++26
parent_of 親スコープのリフレクションを取得 C++26

アクセス指定子

名前 説明 対応バージョン
is_public publicであるか C++26
is_protected protectedであるか C++26
is_private privateであるか C++26
is_accessible 指定したアクセスコンテキストでアクセス可能か C++26
has_inaccessible_nonstatic_data_members アクセス不可能なメンバ変数があるか C++26
has_inaccessible_bases アクセス不可能な基底クラスがあるか C++26
has_inaccessible_subobjects アクセス不可能な基底クラスまたはメンバ変数があるか C++26

エンティティの分類

名前 説明 対応バージョン
is_variable 変数であるか C++26
is_type 型であるか C++26
is_namespace 名前空間であるか C++26
is_type_alias 型エイリアスであるか C++26
is_namespace_alias 名前空間エイリアスであるか C++26
is_function 関数であるか C++26
is_enumerator 列挙子であるか C++26
is_value 値であるか C++26
is_object オブジェクトであるか C++26
is_structured_binding 構造化束縛であるか C++26
is_class_member クラスメンバであるか C++26
is_namespace_member 名前空間メンバであるか C++26
is_nonstatic_data_member メンバ変数であるか C++26
is_static_member 静的メンバであるか C++26
is_base 基底クラス関係であるか C++26
is_function_parameter 関数パラメータであるか C++26
is_template テンプレートであるか C++26
is_function_template 関数テンプレートであるか C++26
is_variable_template 変数テンプレートであるか C++26
is_class_template クラステンプレートであるか C++26
is_alias_template エイリアステンプレートであるか C++26
is_conversion_function_template 変換関数テンプレートであるか C++26
is_operator_function_template 演算子関数テンプレートであるか C++26
is_literal_operator_template リテラル演算子テンプレートであるか C++26
is_constructor_template コンストラクタテンプレートであるか C++26
is_concept コンセプトであるか C++26
is_complete_type 完全型であるか C++26
is_enumerable_type 列挙可能型であるか C++26

関数の分類

名前 説明 対応バージョン
is_conversion_function 変換関数であるか C++26
is_operator_function 演算子関数であるか C++26
is_literal_operator リテラル演算子であるか C++26
is_special_member_function 特殊メンバ関数であるか C++26
is_constructor コンストラクタであるか C++26
is_default_constructor デフォルトコンストラクタであるか C++26
is_copy_constructor コピーコンストラクタであるか C++26
is_move_constructor ムーブコンストラクタであるか C++26
is_assignment 代入演算子であるか C++26
is_copy_assignment コピー代入演算子であるか C++26
is_move_assignment ムーブ代入演算子であるか C++26
is_destructor デストラクタであるか C++26
is_deleted = deleteされているか C++26
is_defaulted = defaultされているか C++26
is_explicit explicitであるか C++26
is_noexcept noexceptであるか C++26
is_user_provided ユーザー提供であるか C++26
is_user_declared ユーザー宣言であるか C++26

関数パラメータの検査

名前 説明 対応バージョン
parameters_of 関数パラメータのリフレクションを取得 C++26
return_type_of 関数の戻り値型のリフレクションを取得 C++26
variable_of パラメータ変数のリフレクションを取得 C++26
has_default_argument デフォルト引数を持つか C++26
is_vararg_function 可変長引数を持つか C++26
is_explicit_object_parameter 明示的オブジェクトパラメータであるか C++26

メンバの性質

名前 説明 対応バージョン
is_virtual virtualであるか C++26
is_pure_virtual 純粋仮想であるか C++26
is_override overrideであるか C++26
is_final finalであるか C++26
is_const const修飾されているか C++26
is_volatile volatile修飾されているか C++26
is_mutable_member mutableメンバであるか C++26
is_lvalue_reference_qualified 左辺値参照修飾されているか C++26
is_rvalue_reference_qualified 右辺値参照修飾されているか C++26
is_bit_field ビットフィールドであるか C++26
has_default_member_initializer デフォルトメンバ初期化子を持つか C++26

記憶域とリンケージ

名前 説明 対応バージョン
has_static_storage_duration 静的記憶域期間を持つか C++26
has_thread_storage_duration スレッド記憶域期間を持つか C++26
has_automatic_storage_duration 自動記憶域期間を持つか C++26
has_internal_linkage 内部リンケージを持つか C++26
has_module_linkage モジュールリンケージを持つか C++26
has_external_linkage 外部リンケージを持つか C++26
has_c_language_linkage C言語リンケージを持つか C++26
has_linkage リンケージを持つか C++26

メンバ・基底クラスの取得

名前 説明 対応バージョン
members_of すべてのメンバを取得 C++26
bases_of 基底クラスを取得 C++26
static_data_members_of 静的データメンバを取得 C++26
nonstatic_data_members_of メンバ変数を取得 C++26
enumerators_of 列挙子を取得 C++26
subobjects_of 基底クラスとメンバ変数を統合して取得 C++26

テンプレート操作

名前 説明 対応バージョン
has_template_arguments テンプレート引数を持つか C++26
template_of テンプレートのリフレクションを取得 C++26
template_arguments_of テンプレート引数のリフレクションを取得 C++26
can_substitute テンプレート引数が置換可能か判定 C++26
substitute テンプレートにテンプレート引数を適用 C++26

レイアウト情報

名前 説明 対応バージョン
member_offset メンバオフセットを表す型 (class) C++26
offset_of メンバのオフセットを取得 C++26
size_of サイズを取得 C++26
alignment_of アライメントを取得 C++26
bit_size_of ビットサイズを取得 C++26

値の抽出と生成

名前 説明 対応バージョン
extract リフレクションから値を抽出 C++26
reflect_constant 値からリフレクションを生成 C++26
reflect_object オブジェクトからリフレクションを生成 C++26
reflect_function 関数からリフレクションを生成 C++26

集成体の定義

名前 説明 対応バージョン
data_member_options データメンバの仕様を指定するオプション (class) C++26
data_member_spec データメンバの仕様を作成 C++26
is_data_member_spec データメンバの仕様であるか C++26
define_aggregate 集成体型を定義 C++26

静的ストレージへの配置

以下のdefine_static_*is_string_literalstd名前空間に定義される(std::meta名前空間ではない)。reflect_constant_*std::meta名前空間に定義される。

名前 説明 対応バージョン
define_static_string コンパイル時文字列を静的ストレージに配置しconst CharT*を返す C++26
define_static_array コンパイル時配列を静的ストレージに配置しspan<const T>を返す C++26
define_static_object コンパイル時オブジェクトを静的ストレージに配置しconst T*を返す C++26
reflect_constant_string コンパイル時文字列のリフレクションを生成する C++26
reflect_constant_array コンパイル時配列のリフレクションを生成する C++26
is_string_literal ポインタが文字列リテラルを指しているかを判定する C++26

アノテーション

名前 説明 対応バージョン
is_annotation アノテーションであるか C++26
annotations_of すべてのアノテーションを取得 C++26
annotations_of_with_type 指定した型のアノテーションのみ取得 C++26

型特性(プライマリ型カテゴリ)

名前 説明 対応バージョン
is_void_type void型か C++26
is_null_pointer_type nullptr_t型か C++26
is_integral_type 整数型か C++26
is_floating_point_type 浮動小数点数型か C++26
is_array_type 配列型か C++26
is_pointer_type ポインタ型か C++26
is_lvalue_reference_type 左辺値参照型か C++26
is_rvalue_reference_type 右辺値参照型か C++26
is_member_object_pointer_type メンバオブジェクトポインタ型か C++26
is_member_function_pointer_type メンバ関数ポインタ型か C++26
is_enum_type 列挙型か C++26
is_union_type 共用体型か C++26
is_class_type クラス型か C++26
is_function_type 関数型か C++26
is_reflection_type リフレクション型か C++26

型特性(複合型カテゴリ)

名前 説明 対応バージョン
is_reference_type 参照型か C++26
is_arithmetic_type 算術型か C++26
is_fundamental_type 基本型か C++26
is_object_type オブジェクト型か C++26
is_scalar_type スカラ型か C++26
is_compound_type 複合型か C++26
is_member_pointer_type メンバポインタ型か C++26

型特性(型の性質)

名前 説明 対応バージョン
is_const_type const型か C++26
is_volatile_type volatile型か C++26
is_trivially_copyable_type トリビアルコピー可能型か C++26
is_standard_layout_type スタンダードレイアウト型か C++26
is_empty_type 空の型か C++26
is_polymorphic_type 多態的型か C++26
is_abstract_type 抽象型か C++26
is_final_type final型か C++26
is_aggregate_type 集成体型か C++26
is_signed_type 符号付き型か C++26
is_unsigned_type 符号なし型か C++26
is_bounded_array_type 境界付き配列型か C++26
is_unbounded_array_type 境界なし配列型か C++26
is_scoped_enum_type スコープ付き列挙型か C++26
is_constructible_type 構築可能型か C++26
is_default_constructible_type デフォルト構築可能型か C++26
is_copy_constructible_type コピー構築可能型か C++26
is_move_constructible_type ムーブ構築可能型か C++26
is_assignable_type 代入可能型か C++26
is_copy_assignable_type コピー代入可能型か C++26
is_move_assignable_type ムーブ代入可能型か C++26
is_swappable_with_type 指定型とのswap可能型か C++26
is_swappable_type swap可能型か C++26
is_destructible_type 破棄可能型か C++26
is_trivially_constructible_type トリビアルに構築可能型か C++26
is_trivially_default_constructible_type トリビアルにデフォルト構築可能型か C++26
is_trivially_copy_constructible_type トリビアルにコピー構築可能型か C++26
is_trivially_move_constructible_type トリビアルにムーブ構築可能型か C++26
is_trivially_assignable_type トリビアルに代入可能型か C++26
is_trivially_copy_assignable_type トリビアルにコピー代入可能型か C++26
is_trivially_move_assignable_type トリビアルにムーブ代入可能型か C++26
is_trivially_destructible_type トリビアルに破棄可能型か C++26
is_nothrow_constructible_type 例外を送出せずに構築可能型か C++26
is_nothrow_default_constructible_type 例外を送出せずにデフォルト構築可能型か C++26
is_nothrow_copy_constructible_type 例外を送出せずにコピー構築可能型か C++26
is_nothrow_move_constructible_type 例外を送出せずにムーブ構築可能型か C++26
is_nothrow_assignable_type 例外を送出せずに代入可能型か C++26
is_nothrow_copy_assignable_type 例外を送出せずにコピー代入可能型か C++26
is_nothrow_move_assignable_type 例外を送出せずにムーブ代入可能型か C++26
is_nothrow_swappable_with_type 例外を送出せずに指定型とswap可能型か C++26
is_nothrow_swappable_type 例外を送出せずにswap可能型か C++26
is_nothrow_destructible_type 例外を送出せずに破棄可能型か C++26
is_structural_type 構造的型 C++26
is_implicit_lifetime_type 暗黙の生存期間型か C++26
has_virtual_destructor 仮想デストラクタを持つか C++26
has_unique_object_representations 一意なオブジェクト表現を持つか C++26
reference_constructs_from_temporary 参照が一時オブジェクトから構築されるか C++26
reference_converts_from_temporary 参照への変換が一時オブジェクトを経由するか C++26

型特性(型プロパティクエリ)

名前 説明 対応バージョン
rank 配列型の次元数を取得 C++26
extent 配列型の指定次元の要素数を取得 C++26

型特性(型の関係)

名前 説明 対応バージョン
is_same_type 同じ型か C++26
is_base_of_type 基底クラスであるか C++26
is_virtual_base_of_type 仮想基底クラスであるか C++26
is_convertible_type 変換可能か C++26
is_nothrow_convertible_type 例外を送出せずに変換可能か C++26
is_layout_compatible_type レイアウト互換か C++26
is_pointer_interconvertible_base_of_type ポインタ相互変換可能な基底クラスか C++26
is_invocable_type 呼び出し可能か C++26
is_invocable_r_type 指定戻り値型で呼び出し可能か C++26
is_nothrow_invocable_type 例外を送出せずに呼び出し可能か C++26
is_nothrow_invocable_r_type 例外を送出せずに指定戻り値型で呼び出し可能か C++26
is_applicable_type tuple-like型の各要素を引数として呼び出し可能か C++26
is_nothrow_applicable_type tuple-like型の各要素を引数として例外を送出せずに呼び出し可能か C++26

型変換

名前 説明 対応バージョン
remove_const constを除去 C++26
remove_volatile volatileを除去 C++26
remove_cv CV修飾を除去 C++26
add_const constを付加 C++26
add_volatile volatileを付加 C++26
add_cv CV修飾を付加 C++26
remove_reference 参照を除去 C++26
add_lvalue_reference 左辺値参照を付加 C++26
add_rvalue_reference 右辺値参照を付加 C++26
remove_cvref CV修飾と参照を除去 C++26
remove_pointer ポインタを除去 C++26
add_pointer ポインタを付加 C++26
decay 配列・関数からポインタへの変換を適用 C++26
make_signed 符号付き型に変換 C++26
make_unsigned 符号なし型に変換 C++26
remove_extent 配列の次元を除去 C++26
remove_all_extents 配列のすべての次元を除去 C++26
common_type 共通型を取得 C++26
common_reference 共通参照型を取得 C++26
underlying_type 基底型を取得 C++26
invoke_result 呼び出し結果型を取得 C++26
apply_result tuple-like型を引数として適用したときの結果型を取得 C++26
unwrap_reference reference_wrapperを展開 C++26
unwrap_ref_decay decay後にreference_wrapperを展開 C++26
tuple_size tuple-like型の要素数を取得 C++26
tuple_element tuple-like型の要素型を取得 C++26
variant_size variant型の候補型の数を取得 C++26
variant_alternative variant型の候補型を取得 C++26
type_order 型の順序を取得 C++26

エラー処理

名前 説明 対応バージョン
exception リフレクションメタ関数のエラーを表す例外クラス (class) C++26

バージョン

言語

  • C++26

処理系

関連項目

参照