#
This subclause specifies consteval functions to query the properties of types ([meta.unary]), query the relationships between types ([meta.rel]), or transform types ([meta.trans]), during program translation.
Each consteval function declared in this class has an associated class template declared elsewhere in this document.
2
#
Every function and function template declared in this subclause throws an exception of type meta​::​exception unless the following conditions are met:
  • For every parameter p of type info, is_type(p) is true.
  • For every parameter r whose type is constrained on reflection_range, ranges​::​​all_of(​r, is_type) is true.
/ associated with [meta.unary.cat], primary type categories consteval bool is_void_type(info type); consteval bool is_null_pointer_type(info type); consteval bool is_integral_type(info type); consteval bool is_floating_point_type(info type); consteval bool is_array_type(info type); consteval bool is_pointer_type(info type); consteval bool is_lvalue_reference_type(info type); consteval bool is_rvalue_reference_type(info type); consteval bool is_member_object_pointer_type(info type); consteval bool is_member_function_pointer_type(info type); consteval bool is_enum_type(info type); consteval bool is_union_type(info type); consteval bool is_class_type(info type); consteval bool is_function_type(info type); consteval bool is_reflection_type(info type); / associated with [meta.unary.comp], composite type categories consteval bool is_reference_type(info type); consteval bool is_arithmetic_type(info type); consteval bool is_fundamental_type(info type); consteval bool is_object_type(info type); consteval bool is_scalar_type(info type); consteval bool is_compound_type(info type); consteval bool is_member_pointer_type(info type); / associated with [meta.unary.prop], type properties consteval bool is_const_type(info type); consteval bool is_volatile_type(info type); consteval bool is_trivially_copyable_type(info type); consteval bool is_standard_layout_type(info type); consteval bool is_empty_type(info type); consteval bool is_polymorphic_type(info type); consteval bool is_abstract_type(info type); consteval bool is_final_type(info type); consteval bool is_aggregate_type(info type); consteval bool is_consteval_only_type(info type); consteval bool is_signed_type(info type); consteval bool is_unsigned_type(info type); consteval bool is_bounded_array_type(info type); consteval bool is_unbounded_array_type(info type); consteval bool is_scoped_enum_type(info type); template<reflection_range R = initializer_list<info>> consteval bool is_constructible_type(info type, R&& type_args); consteval bool is_default_constructible_type(info type); consteval bool is_copy_constructible_type(info type); consteval bool is_move_constructible_type(info type); consteval bool is_assignable_type(info type_dst, info type_src); consteval bool is_copy_assignable_type(info type); consteval bool is_move_assignable_type(info type); consteval bool is_swappable_with_type(info type1, info type2); consteval bool is_swappable_type(info type); consteval bool is_destructible_type(info type); template<reflection_range R = initializer_list<info>> consteval bool is_trivially_constructible_type(info type, R&& type_args); consteval bool is_trivially_default_constructible_type(info type); consteval bool is_trivially_copy_constructible_type(info type); consteval bool is_trivially_move_constructible_type(info type); consteval bool is_trivially_assignable_type(info type_dst, info type_src); consteval bool is_trivially_copy_assignable_type(info type); consteval bool is_trivially_move_assignable_type(info type); consteval bool is_trivially_destructible_type(info type); template<reflection_range R = initializer_list<info>> consteval bool is_nothrow_constructible_type(info type, R&& type_args); consteval bool is_nothrow_default_constructible_type(info type); consteval bool is_nothrow_copy_constructible_type(info type); consteval bool is_nothrow_move_constructible_type(info type); consteval bool is_nothrow_assignable_type(info type_dst, info type_src); consteval bool is_nothrow_copy_assignable_type(info type); consteval bool is_nothrow_move_assignable_type(info type); consteval bool is_nothrow_swappable_with_type(info type1, info type2); consteval bool is_nothrow_swappable_type(info type); consteval bool is_nothrow_destructible_type(info type); consteval bool is_implicit_lifetime_type(info type); consteval bool has_virtual_destructor(info type); consteval bool has_unique_object_representations(info type); consteval bool reference_constructs_from_temporary(info type_dst, info type_src); consteval bool reference_converts_from_temporary(info type_dst, info type_src); / associated with [meta.rel], type relations consteval bool is_same_type(info type1, info type2); consteval bool is_base_of_type(info type_base, info type_derived); consteval bool is_virtual_base_of_type(info type_base, info type_derived); consteval bool is_convertible_type(info type_src, info type_dst); consteval bool is_nothrow_convertible_type(info type_src, info type_dst); consteval bool is_layout_compatible_type(info type1, info type2); consteval bool is_pointer_interconvertible_base_of_type(info type_base, info type_derived); template<reflection_range R = initializer_list<info>> consteval bool is_invocable_type(info type, R&& type_args); template<reflection_range R = initializer_list<info>> consteval bool is_invocable_r_type(info type_result, info type, R&& type_args); template<reflection_range R = initializer_list<info>> consteval bool is_nothrow_invocable_type(info type, R&& type_args); template<reflection_range R = initializer_list<info>> consteval bool is_nothrow_invocable_r_type(info type_result, info type, R&& type_args); / associated with [meta.trans.cv], const-volatile modifications consteval info remove_const(info type); consteval info remove_volatile(info type); consteval info remove_cv(info type); consteval info add_const(info type); consteval info add_volatile(info type); consteval info add_cv(info type); / associated with [meta.trans.ref], reference modifications consteval info remove_reference(info type); consteval info add_lvalue_reference(info type); consteval info add_rvalue_reference(info type); / associated with [meta.trans.sign], sign modifications consteval info make_signed(info type); consteval info make_unsigned(info type); / associated with [meta.trans.arr], array modifications consteval info remove_extent(info type); consteval info remove_all_extents(info type); / associated with [meta.trans.ptr], pointer modifications consteval info remove_pointer(info type); consteval info add_pointer(info type); / associated with [meta.trans.other], other transformations consteval info remove_cvref(info type); consteval info decay(info type); template<reflection_range R = initializer_list<info>> consteval info common_type(R&& type_args); template<reflection_range R = initializer_list<info>> consteval info common_reference(R&& type_args); consteval info underlying_type(info type); template<reflection_range R = initializer_list<info>> consteval info invoke_result(info type, R&& type_args); consteval info unwrap_reference(info type); consteval info unwrap_ref_decay(info type);
3
#
For a function or function template F defined in this subclause, let C be its associated class template.
For the evaluation of a call to F, let S be the specialization of C in terms of which the call is specified.
4
#
Each function or function template declared above has the following behavior based on the signature and return type of that function or function template.
[Note 2: 
The associated class template need not be instantiated.
— end note]
Table 64 — Reflection type traits [tab:meta.reflection.traits]
Signature and Return Type
Returns
bool meta​::​UNARY(info type);
bool meta​::​UNARY_type(info type);
std​::​UNARY<T>​::​value, where T is the type or type alias represented by type
bool meta​::​BINARY(info t1, info t2);
bool meta​::​BINARY_type(info t1, info t2);
std​::​BINARY<
template<reflection_range R>
bool meta​::​VARIADIC_type(info type, R&& args);
std​::​VARIADIC<T, U.>​::​value, where T is the type or type alias represented by type and U.. is the pack of types or type aliases whose elements are represented by the corresponding elements of args
template<reflection_range R>
bool meta​::​VARIADIC_type(info t1, info t2, R&& args);
std​::​VARIADIC<
info meta​::​UNARY(info type);
A reflection representing the type denoted by std​::​UNARY<T>​::​type, where T is the type or type alias represented by type
template<reflection_range R>
info meta​::​VARIADIC(R&& args);
A reflection representing the type denoted by std​::​VARIADIC<T.>​::​type, where T. is the pack of types or type aliases whose elements are represented by the corresponding elements of args
template<reflection_range R>
info meta​::​VARIADIC(info type, R&& args);
A reflection representing the type denoted by std​::​VARIADIC<T, U.>​::​type, where T is the type or type alias represented by type and U. is the pack of types or type aliases whose elements are represented by the corresponding elements of args
[Note 3: 
For those functions or function templates which return a reflection, that reflection always represents a type and never a type alias.
— end note]
[Note 4: 
If t is a reflection of the type int and u is a reflection of an alias to the type int, then t == u is false but is_same_type(t, u) is true.
Also, t == dealias(u) is true.
— end note]
consteval size_t rank(info type);
Returns: std​::​rank<T>​::​value, where T is the type represented by dealias(type).
consteval size_t extent(info type, unsigned i = 0);
Returns: std​::​extent<T, I>​::​value, where T is the type represented by dealias(type) and I is a constant equal to i.
consteval size_t tuple_size(info type);
Returns: std​::​tuple_size<T>​::​value, where T is the type represented by dealias(type).
consteval info tuple_element(size_t index, info type);
Returns: A reflection representing the type denoted by std​::​tuple_element<I, T>​::​type, where T is the type represented by dealias(type) and I is a constant equal to index.
consteval size_t variant_size(info type);
Returns: std​::​variant_size<T>​::​value, where T is the type represented by dealias(type).
consteval info variant_alternative(size_t index, info type);
Returns: A reflection representing the type denoted by std​::​variant_alternative<I, T>​::​type, where T is the type represented by dealias(type) and I is a constant equal to index.
consteval strong_ordering type_order(info t1, info t2);
Returns: std​::​type_order<

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant