Experimental library header <experimental/reflect>
From cppreference.net
<
cpp
|
header
|
experimental
此头文件属于 Reflection TS 的一部分。
|
定义于 命名空间
std::experimental::reflect
|
|
|
定义于内联命名空间
std::experimental::reflect::v1
|
|
概念 |
|
|
(reflection TS)
|
指定某个类型为元对象类型
(concept) |
|
(reflection TS)
|
指定元对象类型为元对象序列类型
(concept) |
|
(reflection TS)
|
指定元对象类型反映模板参数作用域
(概念) |
|
(reflection TS)
|
指定元对象类型反映具有关联(可能为空)名称的实体或别名
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是类型别名、命名空间别名或由 using 声明引入的别名
(concept) |
|
(reflection TS)
|
指定元对象类型反映类的
member-declaration
(concept) |
|
(reflection TS)
|
指定元对象类型反映枚举器
(concept) |
|
(reflection TS)
|
指定元对象类型反映变量或数据成员
(concept) |
|
(reflection TS)
|
指定元对象类型满足
RecordMember
、
Enumerator
或
Variable
概念,或反射除全局命名空间之外的命名空间
(概念) |
|
(reflection TS)
|
指定元对象类型反映具有类型的实体
(concept) |
|
(reflection TS)
|
指定元对象类型反射命名空间
(concept) |
|
(reflection TS)
|
指定元对象类型反映全局命名空间
(concept) |
|
(reflection TS)
|
指定元对象类型反映非联合类类型
(concept) |
|
(reflection TS)
|
指定元对象类型反映枚举类型
(concept) |
|
(reflection TS)
|
指定元对象类型反映类类型
(concept) |
|
(reflection TS)
|
指定元对象类型反映命名空间、类、枚举、函数、闭包类型或模板参数作用域
(概念) |
|
(reflection TS)
|
指定元对象类型反映类型信息
(concept) |
|
(reflection TS)
|
指定元对象类型反映枚举项或常量表达式变量
(concept) |
|
(reflection TS)
|
指定元对象类型反映从
get_base_classes
获取的直接基类
(概念) |
|
(reflection TS)
|
指定元对象类型反映函数形参
(concept) |
|
(reflection TS)
|
指定元对象类型反映函数(包括构造函数和析构函数)
(concept) |
|
(reflection TS)
|
指定元对象类型反映表达式
(concept) |
|
(reflection TS)
|
指定元对象类型反映括号表达式
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是
function-call-expression
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是
functional-type-conv-expression
(概念) |
|
(reflection TS)
|
指定元对象类型反映函数(不包括构造函数和析构函数)
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是成员函数(不包括构造函数和析构函数)
(concept) |
|
(reflection TS)
|
指定元对象类型反映特殊成员函数
(概念) |
|
(reflection TS)
|
指定元对象类型反映构造函数
(concept) |
|
(reflection TS)
|
指定元对象类型反映析构函数
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是运算符函数或转换函数
(concept) |
|
(reflection TS)
|
指定元对象类型反映转换函数
(concept) |
|
(reflection TS)
|
指定元对象类型反映非泛型lambda的闭包类型
(concept) |
|
(reflection TS)
|
指定元对象类型反映的是lambda捕获
(概念) |
类 |
|
|
|
|
(reflection TS)
|
检查两个元对象类型是否反映同一实体或别名
(类模板) |
|
(reflection TS)
|
获取被反射实体或别名声明的推定行号
(类模板) |
|
(reflection TS)
|
获取被反射实体或别名声明的实现定义列号
(类模板) |
|
(reflection TS)
|
获取被反射实体或别名的声明所在的推定文件名
(类模板) |
|
|
|
(反射TS)
|
获取元对象序列的大小
(类模板) |
|
(reflection TS)
|
获取序列中指定索引的元对象类型
(类模板) |
|
(reflection TS)
|
将模板应用于元对象序列
(类模板) |
|
|
|
(reflection TS)
|
检查反射的实体或别名是否具有名称
(类模板) |
|
(reflection TS)
|
获取反射实体或别名的非限定名称
(类模板) |
|
(reflection TS)
|
获取反射实体或别名的实现定义显示名称
(类模板) |
|
|
|
(reflection TS)
|
获取反映反射别名关联实体的元对象类型
(类模板) |
|
|
|
(反射TS)
|
获取反映被反射实体或别名类型的元对象类型
(类模板) |
|
(reflection TS)
|
获取反射实体或别名的类型
(类模板) |
|
(reflection TS)
|
检查元对象类型是否反映枚举类型
(类模板) |
|
(reflection TS)
|
检查元对象类型是否反映联合类型
(类模板) |
|
(reflection TS)
|
检查元对象类型是否反映使用
class
或
struct
分别声明的非联合类类型
(类模板) |
|
|
|
(reflection TS)
|
获取反映被反射实体或别名作用域的元对象类型
(类模板) |
|
|
|
(反射TS)
|
获取反映给定基类关系中基类的元对象类型
(类模板) |
|
|
|
(reflection TS)
|
检查反射的成员或基类是否为公开访问
(类模板) |
|
(reflection TS)
|
检查反射的成员或基类是否为受保护成员
(类模板) |
|
(reflection TS)
|
检查反射的成员或基类是否为私有
(类模板) |
|
|
|
获取一个元对象序列类型,其元素反映被反射类的公开、可访问或所有数据成员
(类模板) |
|
|
获取元对象序列类型,其元素反映被反射类的公开、可访问或所有成员函数
(类模板) |
|
|
(reflection TS)
|
获取一个元对象序列类型,其元素反映被反射类的所有构造函数
(类模板) |
|
(reflection TS)
|
获取一个元对象序列类型,其元素反映被反射类中声明的所有运算符函数和转换函数
(类模板) |
|
(reflection TS)
|
获取反映类的析构函数的元对象类型
(类模板) |
|
获取一个元对象序列类型,其元素反映被反射类的公开、可访问或所有嵌套类型及成员类型定义
(类模板) |
|
|
获取一个元对象序列类型,其元素反映被反射类的公有、可访问或所有基类
(类模板) |
|
|
|
|
(reflection TS)
|
检查反射的枚举是否为作用域枚举
(类模板) |
|
(reflection TS)
|
获取一个元对象序列类型,其元素反映被反射枚举的枚举项
(类模板) |
|
(reflection TS)
|
获取反映被反射枚举底层类型的元对象类型
(类模板) |
|
|
|
(reflection TS)
|
获取反射变量的值(该变量必须是常量表达式)
(类模板) |
|
(reflection TS)
|
检查变量是否声明为
thread_local
(类模板) |
|
|
|
(reflection TS)
|
检查反射参数是否具有默认实参
(类模板) |
|
|
|
(reflection TS)
|
获取元对象序列类型,其元素反映被反射函数的参数
(类模板) |
|
(reflection TS)
|
检查反射函数的参数列表是否包含省略号参数
(类模板) |
|
(reflection TS)
|
检查反射函数是否不抛出异常
(类模板) |
|
(reflection TS)
|
检查反射函数是否被删除
(类模板) |
|
|
|
(reflection TS)
|
检查反射的变量或函数是否为 constexpr
(类模板) |
|
|
|
(reflection TS)
|
检查反射的命名空间或函数是否为内联
(类模板) |
|
|
|
(reflection TS)
|
获取反映带括号表达式的无括号表达式的元对象类型
(类模板) |
|
|
|
(reflection TS)
|
获取反映反射函数调用表达式中函数的元对象类型
(类模板) |
|
|
|
(reflection TS)
|
获取反映构造函数在反射式
functional-type-conv-expression
中的元对象类型
(类模板) |
|
|
|
(反射技术规范)
|
获取被反射变量或函数的地址,或指向被反射非静态成员的成员指针值
(类模板) |
|
|
|
检查被反射的成员函数是否分别声明了
const
、
volatile
、
&
或
&&
限定符
(类模板) |
|
|
(reflection TS)
|
检查反射的成员函数是否重写基类的成员函数
(类模板) |
|
|
|
(reflection TS)
|
检查反射的类或成员函数是否被标记为
final
(类模板) |
|
|
|
(reflection TS)
|
检查反射变量是否具有静态存储期,或反射成员函数是否为静态
(类模板) |
|
|
|
(reflection TS)
|
检查反射的特殊成员函数是否为隐式声明
(类模板) |
|
(reflection TS)
|
检查反射的特殊成员函数是否在其首次声明中被默认生成
(类模板) |
|
|
|
(reflection TS)
|
检查被反射的构造函数或转换函数是否声明为
explicit
(类模板) |
|
|
|
(reflection TS)
|
检查反射的成员函数是否为虚函数
(类模板) |
|
(reflection TS)
|
检查反射的成员函数是否为纯虚函数
(类模板) |
|
|
|
(reflection TS)
|
获取元对象序列类型,其元素反映被反射闭包类型的捕获项
(类模板) |
|
(reflection TS)
|
检查反射闭包类型的lambda表达式的捕获默认值是否为
=
或
&
(分别对应)
(类模板) |
|
(reflection TS)
|
检查被反射的闭包类型的
operator()
是否声明为
const
(类模板) |
|
|
|
(reflection TS)
|
检查反射的 lambda 捕获是否为显式捕获
(类模板) |
|
(reflection TS)
|
检查反射的lambda捕获是否为初始化捕获
(类模板) |
概要
namespace std::实验性::reflect { inline namespace v1 { // 21.12.3 元对象类型概念 template <class T> concept Object = /* 查看描述 */; template <class T> concept ObjectSequence = /* 参见描述 */; // refines Object template <class T> concept TemplateParameterScope = /* 查看描述 */; // 精化作用域 template <class T> concept Named = /* 查看描述 */; // refines Object template <class T> concept Alias = /* 查看描述 */; // 精化 Named 和 ScopeMember template <class T> concept RecordMember = /* 查看描述 */; // 精化 ScopeMember template <class T> concept Enumerator = /* 查看描述 */; // 精化常量 template <class T> concept Variable = /* 查看描述 */; // 精化 Typed 和 ScopeMember template <class T> concept ScopeMember = /* 查看描述 */; // 精化 Named template <class T> concept Typed = /* 查看描述 */; // refines Object template <class T> concept Namespace = /* 查看描述 */; // 精化 Named 和 Scope template <class T> concept GlobalScope = /* 查看描述 */; // refines Namespace template <class T> concept Class = /* 查看描述 */; // 精化记录 template <class T> concept Enum = /* 查看描述 */; // refines Type, Scope, and ScopeMember template <class T> concept Record = /* 查看描述 */; // 精炼 Type、Scope 和 ScopeMember template <class T> concept Scope = /* 查看描述 */; // refines Object template <class T> concept Type = /* 查看描述 */; // 精化 Named template <class T> concept Constant = /* 查看描述 */; // 精化 Typed 和 ScopeMember template <class T> concept Base = /* 查看描述 */; // refines Object template <class T> concept FunctionParameter = /* 查看描述 */; // 精化 Typed 和 ScopeMember template <class T> concept Callable = /* 查看描述 */; // 精化 Scope 和 ScopeMember template <class T> concept Expression = /* 查看描述 */; // refines Object template <class T> concept ParenthesizedExpression = /* 查看描述 */; // refines Expression template <class T> concept FunctionCallExpression = /* 查看描述 */; // refines Expression template <class T> concept FunctionalTypeConversion = /* 查看描述 */; // refines Expression template <class T> concept Function = /* 参见描述 */; // 精炼 Typed 和 Callable template <class T> concept MemberFunction = /* 查看描述 */; // refines RecordMember and Function template <class T> concept SpecialMemberFunction = /* 查看描述 */; // refines RecordMember template <class T> concept Constructor = /* 查看描述 */; // 精炼 Callable 和 RecordMember template <class T> concept Destructor = /* 查看描述 */; // 精炼 Callable 和 SpecialMemberFunction template <class T> concept Operator = /* 查看描述 */; // 精化函数 template <class T> concept ConversionOperator = /* 查看描述 */; // refines MemberFunction and Operator template <class T> concept Lambda = /* 查看描述 */; // 精化类型与作用域 template <class T> concept LambdaCapture = /* 查看描述 */; // refines Variable // 21.12.4 元对象操作 // 多概念操作 template <Object T> struct is_public; template <Object T> struct is_protected; template <Object T> struct is_private; template <Object T> struct is_constexpr; template <Object T> struct is_static; template <Object T> struct is_final; template <Object T> struct is_explicit; template <Object T> struct is_inline; template <Object T> struct is_virtual; template <Object T> struct is_pure_virtual; template <Object T> struct get_pointer; template <class T> requires RecordMember<T> || Base<T> constexpr auto is_public_v = is_public<T>::值; template <class T> requires RecordMember<T> || Base<T> constexpr auto is_protected_v = is_protected<T>::值; template <class T> requires RecordMember<T> || Base<T> constexpr auto is_private_v = is_private<T>::值; template <class T> requires Variable<T> || Callable<T> constexpr auto is_constexpr_v = is_constexpr<T>::值; template <class T> requires Variable<T> || MemberFunction<T> constexpr auto is_static_v = is_static<T>::值; template <class T> requires Class<T> || MemberFunction<T> constexpr auto is_final_v = is_final<T>::值; template <class T> requires Constructor<T> || ConversionOperator<T> constexpr auto is_explicit_v = is_explicit<T>::值; template <class T> requires Namespace<T> || Callable<T> constexpr auto is_inline_v = is_inline<T>::值; template <class T> requires Base<T> || MemberFunction<T> || Destructor<T> constexpr auto is_virtual_v = is_virtual<T>::值; template <class T> requires MemberFunction<T> || Destructor<T> constexpr auto is_pure_virtual_v = is_pure_virtual<T>::值; template <class T> requires Variable<T> || Function<T> constexpr auto get_pointer_v = get_pointer<T>::值; // 21.12.4.1 Object operations template <Object T1, Object T2> struct reflects_same; template <Object T> struct get_source_line; template <Object T> struct get_source_column; template <Object T> struct get_source_file_name; template <Object T1, Object T2> constexpr auto reflects_same_v = reflects_same<T1, T2>::值; template <class T> constexpr auto get_source_line_v = get_source_line<T>::值; template <class T> constexpr auto get_source_column_v = get_source_column<T>::值; template <class T> constexpr auto get_source_file_name_v = get_source_file_name<T>::值; // 21.12.4.2 ObjectSequence 操作 template <ObjectSequence T> struct get_size; template <size_t I, ObjectSequence T> struct get_element; template <template <class...> class Tpl, ObjectSequence T> struct unpack_sequence; template <ObjectSequence T> constexpr auto get_size_v = get_size<T>::值; template <size_t I, ObjectSequence T> using get_element_t = typename get_element<I, T>::type; template <template <class...> class Tpl, ObjectSequence T> using unpack_sequence_t = typename unpack_sequence<Tpl, T>::type; // 21.12.4.3 命名操作 template <Named T> struct is_unnamed; template <Named T> struct get_name; template <Named T> struct get_display_name; template <Named T> constexpr auto is_unnamed_v = is_unnamed<T>::值; template <Named T> constexpr auto get_name_v = get_name<T>::值; template <Named T> constexpr auto get_display_name_v = get_display_name<T>::值; // 21.12.4.4 别名操作 template <Alias T> struct get_aliased; template <Alias T> using get_aliased_t = typename get_aliased<T>::type; // 21.12.4.5 类型操作 template <Typed T> struct get_type; template <Type T> struct get_reflected_type; template <Type T> struct is_enum; template <Class T> struct uses_class_key; template <Class T> struct uses_struct_key; template <Type T> struct is_union; template <Typed T> using get_type_t = typename get_type<T>::type; template <Type T> using get_reflected_type_t = typename get_reflected_type<T>::type; template <Type T> constexpr auto is_enum_v = is_enum<T>::值; template <Class T> constexpr auto uses_class_key_v = uses_class_key<T>::值; template <Class T> constexpr auto uses_struct_key_v = uses_struct_key<T>::值; template <Type T> constexpr auto is_union_v = is_union<T>::值; // 21.12.4.6 成员操作 template <ScopeMember T> struct get_scope; template <RecordMember T> struct is_public<T>; template <RecordMember T> struct is_protected<T>; template <RecordMember T> struct is_private<T>; template <ScopeMember T> using get_scope_t = typename get_scope<T>::type; // 21.12.4.7 Record operations template <Record T> struct get_public_data_members; template <Record T> struct get_accessible_data_members; template <Record T> struct get_data_members; template <Record T> struct get_public_member_functions; template <Record T> struct get_accessible_member_functions; template <Record T> struct get_member_functions; template <Record T> struct get_public_member_types; template <Record T> struct get_accessible_member_types; template <Record T> struct get_member_types; template <Record T> struct get_constructors; template <Record T> struct get_destructor; template <Record T> struct get_operators; template <Class T> struct get_public_base_classes; template <Class T> struct get_accessible_base_classes; template <Class T> struct get_base_classes; template <Class T> struct is_final<T>; template <Record T> using get_public_data_members_t = typename get_public_data_members<T>::type; template <Record T> using get_accessible_data_members_t = typename get_accessible_data_members<T>::type; template <Record T> using get_data_members_t = typename get_data_members<T>::type; template <Record T> using get_public_member_functions_t = typename get_public_member_functions<T>::type; template <Record T> using get_accessible_member_functions_t = typename get_accessible_member_functions<T>::type; template <Record T> using get_member_functions_t = typename get_member_functions<T>::type; template <Record T> using get_public_member_types_t = typename get_public_member_types<T>::type; template <Record T> using get_accessible_member_types_t = typename get_accessible_member_types<T>::type; template <Record T> using get_member_types_t = typename get_member_types<T>::type; template <Record T> using get_constructors_t = typename get_constructors<T>::type; template <Record T> using get_destructor_t = typename get_destructor<T>::type; template <Record T> using get_operators_t = typename get_operators<T>::type; template <Class T> using get_public_base_classes_t = typename get_public_base_classes<T>::type; template <Class T> using get_accessible_base_classes_t = typename get_accessible_base_classes<T>::type; template <Class T> using get_base_classes_t = typename get_base_classes<T>::type; // 21.12.4.8 枚举操作 template <Enum T> struct is_scoped_enum; template <Enum T> struct get_enumerators; template <Enum T> struct get_underlying_type; template <Enum T> constexpr auto is_scoped_enum_v = is_scoped_enum<T>::值; template <Enum T> using get_enumerators_t = typename get_enumerators<T>::type; template <Enum T> using get_underlying_type_t = typename get_underlying_type<T>::type; // 21.12.4.9 值操作 template <Constant T> struct get_constant; template <Variable T> struct is_constexpr<T>; template <Variable T> struct is_static<T>; template <Variable T> struct is_thread_local; template <Variable T> struct get_pointer<T>; template <Constant T> constexpr auto get_constant_v = get_constant<T>::值; template <Variable T> constexpr auto is_thread_local_v = is_thread_local<T>::值; // 21.12.4.10 基础操作 template <Base T> struct get_class; template <Base T> struct is_virtual<T>; template <Base T> struct is_public<T>; template <Base T> struct is_protected<T>; template <Base T> struct is_private<T>; template <Base T> using get_class_t = typename get_class<T>::type; // 21.12.4.11 命名空间操作 template <Namespace T> struct is_inline<T>; // 21.12.4.12 FunctionParameter operations template <FunctionParameter T> struct has_default_argument; template <FunctionParameter T> constexpr auto has_default_argument_v = has_default_argument<T>::值; // 21.12.4.13 可调用操作 template <Callable T> struct get_parameters; template <Callable T> struct is_vararg; template <Callable T> struct is_constexpr<T>; template <Callable T> struct is_noexcept; template <Callable T> struct is_inline<T>; template <Callable T> struct is_deleted; template <Callable T> using get_parameters_t = typename get_parameters<T>::type; template <Callable T> constexpr auto is_vararg_v = is_vararg<T>::值; template <Callable T> constexpr auto is_deleted_v = is_deleted<T>::值; // 21.12.4.14 圆括号表达式操作 template <ParenthesizedExpression T> struct get_subexpression; template <ParenthesizedExpression T> using get_subexpression_t = typename get_subexpression<T>::type; // 21.12.4.15 FunctionCallExpression operations template <FunctionCallExpression T> struct get_callable; template <FunctionCallExpression T> using get_callable_t = typename get_callable<T>::type; // 21.12.4.16 FunctionalTypeConversion operations template <FunctionalTypeConversion T> struct get_constructor; template <FunctionalTypeConversion T> using get_constructor_t = typename get_constructor<T>::type; // 21.12.4.17 函数操作 template <Function T> struct get_pointer<T>; // 21.12.4.18 MemberFunction operations template <MemberFunction T> struct is_static<T>; template <MemberFunction T> struct is_const; template <MemberFunction T> struct is_volatile; template <MemberFunction T> struct has_lvalueref_qualifier; template <MemberFunction T> struct has_rvalueref_qualifier; template <MemberFunction T> struct is_virtual<T>; template <MemberFunction T> struct is_pure_virtual<T>; template <MemberFunction T> struct is_override; template <MemberFunction T> struct is_final<T>; template <MemberFunction T> constexpr auto is_const_v = is_const<T>::值; template <MemberFunction T> constexpr auto is_volatile_v = is_volatile<T>::值; template <MemberFunction T> constexpr auto has_lvalueref_qualifier_v = has_lvalueref_qualifier<T>::值; template <MemberFunction T> constexpr auto has_rvalueref_qualifier_v = has_rvalueref_qualifier<T>::值; template <MemberFunction T> constexpr auto is_override_v = is_override<T>::值; // 21.12.4.19 特殊成员函数操作 template <SpecialMemberFunction T> struct is_implicitly_declared; template <SpecialMemberFunction T> struct is_defaulted; template <SpecialMemberFunction T> constexpr auto is_implicitly_declared_v = is_implicitly_declared<T>::值; template <SpecialMemberFunction T> constexpr auto is_defaulted_v = is_defaulted<T>::值; // 21.12.4.20 构造函数操作 template <Constructor T> struct is_explicit<T>; // 21.12.4.21 析构函数操作 template <Destructor T> struct is_virtual<T>; template <Destructor T> struct is_pure_virtual<T>; // 21.12.4.22 ConversionOperator operations template <ConversionOperator T> struct is_explicit<T>; // 21.12.4.23 Lambda operations template <Lambda T> struct get_captures; template <Lambda T> struct uses_default_copy_capture; template <Lambda T> struct uses_default_reference_capture; template <Lambda T> struct is_call_operator_const; template <Lambda T> using get_captures_t = typename get_captures<T>::type; template <Lambda T> constexpr auto uses_default_copy_capture_v = uses_default_copy_capture<T>::值; template <Lambda T> constexpr auto uses_default_reference_capture_v = uses_default_reference_capture<T>::值; template <Lambda T> constexpr auto is_call_operator_const_v = is_call_operator_const<T>::值; // 21.12.4.24 LambdaCapture operations template <LambdaCapture T> struct is_explicitly_captured; template <LambdaCapture T> struct is_init_capture; template <LambdaCapture T> constexpr auto is_explicitly_captured_v = is_explicitly_captured<T>::值; template <LambdaCapture T> constexpr auto is_init_capture_v = is_init_capture<T>::值; } // inline namespace v1 } // namespace std::experimental::reflect