Files
2025-10-25 03:02:53 +03:00

223 lines
25 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[meta.reflection.traits]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.4 Reflection [[meta.reflection]](meta.reflection#traits)
### 21.4.17 Reflection type traits [meta.reflection.traits]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6569)
This subclause specifies consteval functions to
query the properties of types ([[meta.unary]](meta.unary "21.3.6Unary type traits")),
query the relationships between types ([[meta.rel]](meta.rel "21.3.8Relationships between types")), or
transform types ([[meta.trans]](meta.trans "21.3.9Transformations between types")),
during program translation[.](#1.sentence-1)
Each consteval function declared in this class
has an associated class template declared elsewhere in this document[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6578)
Every function and function template declared in this subclause
throws an exception of type meta::exception unless the following conditions are met:
- [(2.1)](#2.1)
For every parameter p of type info, is_type(p) is true[.](#2.1.sentence-1)
- [(2.2)](#2.2)
For every parameter r whose type is constrained on [reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]"), ranges::all_of(r, is_type) is true[.](#2.2.sentence-1)
// associated with [[meta.unary.cat]](meta.unary.cat "21.3.6.2Primary type categories"), primary type categoriesconsteval bool [is_void_type](#lib:is_void_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_null_pointer_type](#lib:is_null_pointer_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_integral_type](#lib:is_integral_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_floating_point_type](#lib:is_floating_point_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_array_type](#lib:is_array_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_pointer_type](#lib:is_pointer_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_lvalue_reference_type](#lib:is_lvalue_reference_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_rvalue_reference_type](#lib:is_rvalue_reference_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_member_object_pointer_type](#lib:is_member_object_pointer_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_member_function_pointer_type](#lib:is_member_function_pointer_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_enum_type](#lib:is_enum_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_union_type](#lib:is_union_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_class_type](#lib:is_class_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_function_type](#lib:is_function_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_reflection_type](#lib:is_reflection_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.unary.comp]](meta.unary.comp "21.3.6.3Composite type traits"), composite type categoriesconsteval bool [is_reference_type](#lib:is_reference_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_arithmetic_type](#lib:is_arithmetic_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_fundamental_type](#lib:is_fundamental_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_object_type](#lib:is_object_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_scalar_type](#lib:is_scalar_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_compound_type](#lib:is_compound_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_member_pointer_type](#lib:is_member_pointer_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.unary.prop]](meta.unary.prop "21.3.6.4Type properties"), type propertiesconsteval bool [is_const_type](#lib:is_const_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_volatile_type](#lib:is_volatile_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_copyable_type](#lib:is_trivially_copyable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_relocatable_type](#lib:is_trivially_relocatable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_replaceable_type](#lib:is_replaceable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_standard_layout_type](#lib:is_standard_layout_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_empty_type](#lib:is_empty_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_polymorphic_type](#lib:is_polymorphic_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_abstract_type](#lib:is_abstract_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_final_type](#lib:is_final_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_aggregate_type](#lib:is_aggregate_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_consteval_only_type](#lib:is_consteval_only_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_signed_type](#lib:is_signed_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_unsigned_type](#lib:is_unsigned_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_bounded_array_type](#lib:is_bounded_array_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_unbounded_array_type](#lib:is_unbounded_array_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_scoped_enum_type](#lib:is_scoped_enum_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_constructible_type](#lib:is_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);consteval bool [is_default_constructible_type](#lib:is_default_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_copy_constructible_type](#lib:is_copy_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_move_constructible_type](#lib:is_move_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_assignable_type](#lib:is_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_dst, info type_src);consteval bool [is_copy_assignable_type](#lib:is_copy_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_move_assignable_type](#lib:is_move_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_swappable_with_type](#lib:is_swappable_with_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type1, info type2);consteval bool [is_swappable_type](#lib:is_swappable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_destructible_type](#lib:is_destructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_trivially_constructible_type](#lib:is_trivially_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);consteval bool [is_trivially_default_constructible_type](#lib:is_trivially_default_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_copy_constructible_type](#lib:is_trivially_copy_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_move_constructible_type](#lib:is_trivially_move_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_trivially_assignable_type](#lib:is_trivially_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_dst, info type_src);consteval bool [is_trivially_copy_assignable_type](#lib:is_trivially_copy_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_move_assignable_type](#lib:is_trivially_move_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_trivially_destructible_type](#lib:is_trivially_destructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_nothrow_constructible_type](#lib:is_nothrow_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);consteval bool [is_nothrow_default_constructible_type](#lib:is_nothrow_default_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_nothrow_copy_constructible_type](#lib:is_nothrow_copy_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_nothrow_move_constructible_type](#lib:is_nothrow_move_constructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_nothrow_assignable_type](#lib:is_nothrow_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_dst, info type_src);consteval bool [is_nothrow_copy_assignable_type](#lib:is_nothrow_copy_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_nothrow_move_assignable_type](#lib:is_nothrow_move_assignable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_nothrow_swappable_with_type](#lib:is_nothrow_swappable_with_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type1, info type2);consteval bool [is_nothrow_swappable_type](#lib:is_nothrow_swappable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_nothrow_destructible_type](#lib:is_nothrow_destructible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval bool [is_nothrow_relocatable_type](#lib:is_nothrow_relocatable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [is_implicit_lifetime_type](#lib:is_implicit_lifetime_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [has_virtual_destructor](#lib:has_virtual_destructor "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [has_unique_object_representations](#lib:has_unique_object_representations "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
consteval bool [reference_constructs_from_temporary](#lib:reference_constructs_from_temporary "21.4.17Reflection type traits[meta.reflection.traits]")(info type_dst, info type_src);consteval bool [reference_converts_from_temporary](#lib:reference_converts_from_temporary "21.4.17Reflection type traits[meta.reflection.traits]")(info type_dst, info type_src);
// associated with [[meta.rel]](meta.rel "21.3.8Relationships between types"), type relationsconsteval bool [is_same_type](#lib:is_same_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type1, info type2);consteval bool [is_base_of_type](#lib:is_base_of_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_base, info type_derived);consteval bool [is_virtual_base_of_type](#lib:is_virtual_base_of_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_base, info type_derived);consteval bool [is_convertible_type](#lib:is_convertible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_src, info type_dst);consteval bool [is_nothrow_convertible_type](#lib:is_nothrow_convertible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_src, info type_dst);consteval bool [is_layout_compatible_type](#lib:is_layout_compatible_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type1, info type2);consteval bool [is_pointer_interconvertible_base_of_type](#lib:is_pointer_interconvertible_base_of_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_base, info type_derived);
template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_invocable_type](#lib:is_invocable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_invocable_r_type](#lib:is_invocable_r_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_result, info type, R&& type_args);
template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_nothrow_invocable_type](#lib:is_nothrow_invocable_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval bool [is_nothrow_invocable_r_type](#lib:is_nothrow_invocable_r_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type_result, info type, R&& type_args);
// associated with [[meta.trans.cv]](meta.trans.cv "21.3.9.2Const-volatile modifications"), const-volatile modificationsconsteval info [remove_const](#lib:remove_const "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [remove_volatile](#lib:remove_volatile "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [remove_cv](#lib:remove_cv "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_const](#lib:add_const "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_volatile](#lib:add_volatile "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_cv](#lib:add_cv "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.trans.ref]](meta.trans.ref "21.3.9.3Reference modifications"), reference modificationsconsteval info [remove_reference](#lib:remove_reference "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_lvalue_reference](#lib:add_lvalue_reference "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_rvalue_reference](#lib:add_rvalue_reference "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.trans.sign]](meta.trans.sign "21.3.9.4Sign modifications"), sign modificationsconsteval info [make_signed](#lib:make_signed "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [make_unsigned](#lib:make_unsigned "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.trans.arr]](meta.trans.arr "21.3.9.5Array modifications"), array modificationsconsteval info [remove_extent](#lib:remove_extent "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [remove_all_extents](#lib:remove_all_extents "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.trans.ptr]](meta.trans.ptr "21.3.9.6Pointer modifications"), pointer modificationsconsteval info [remove_pointer](#lib:remove_pointer "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [add_pointer](#lib:add_pointer "21.4.17Reflection type traits[meta.reflection.traits]")(info type);
// associated with [[meta.trans.other]](meta.trans.other "21.3.9.7Other transformations"), other transformationsconsteval info [remove_cvref](#lib:remove_cvref "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [decay](#lib:decay "21.4.17Reflection type traits[meta.reflection.traits]")(info type);template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval info [common_type](time.traits.specializations#lib:common_type "30.4.3Specializations of common_­type[time.traits.specializations]")(R&& type_args);template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval info [common_reference](#lib:common_reference "21.4.17Reflection type traits[meta.reflection.traits]")(R&& type_args);consteval info [underlying_type](#lib:underlying_type "21.4.17Reflection type traits[meta.reflection.traits]")(info type);template<[reflection_range](meta.reflection.substitute#concept:reflection_range "21.4.13Reflection substitution[meta.reflection.substitute]") R = initializer_list<info>>consteval info [invoke_result](#lib:invoke_result "21.4.17Reflection type traits[meta.reflection.traits]")(info type, R&& type_args);consteval info [unwrap_reference](#lib:unwrap_reference "21.4.17Reflection type traits[meta.reflection.traits]")(info type);consteval info [unwrap_ref_decay](functional.syn#lib:unwrap_ref_decay "22.10.2Header <functional> synopsis[functional.syn]")(info type);
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6747)
Each function or function template declared above has the following behavior
based on the signature and return type of that function or function template[.](#3.sentence-1)
[*Note [1](#note-1)*:
The associated class template need not be instantiated[.](#3.sentence-2)
— *end note*]
Table [64](#tab:meta.reflection.traits) — Reflection type traits [[tab:meta.reflection.traits]](./tab:meta.reflection.traits)
| [🔗](#tab:meta.reflection.traits-row-1)<br>**Signature and Return Type** | ***Returns*** |
| --- | --- |
| [🔗](#tab:meta.reflection.traits-row-2)<br>bool meta::*UNARY*(info type); bool meta::*UNARY*_type(info type); | std::*UNARY*_v<T>, where T is the type or type alias represented by type |
| [🔗](#tab:meta.reflection.traits-row-3)<br>bool meta::*BINARY*(info t1, info t2); bool meta::*BINARY*_type(info t1, info t2); | std::*BINARY*_v<T1, T2>, where T1 and T2 are the types or type aliases represented by t1 and t2, respectively |
| [🔗](#tab:meta.reflection.traits-row-4)<br>template<reflection_range R> bool meta::*VARIADIC*_type(info type, R&& args); | std::*VARIADIC*_v<T, U...>, 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 |
| [🔗](#tab:meta.reflection.traits-row-5)<br>template<reflection_range R> bool meta::*VARIADIC*_type(info t1, info t2, R&& args); | std::*VARIADIC*_v<T1, T2, U...>, where T1 and T2 are the types or type aliases represented by t1 and t2, respectively, and U... is the pack of types or type aliases whose elements are represented by the corresponding elements of args |
| [🔗](#tab:meta.reflection.traits-row-6)<br>info meta::*UNARY*(info type); | A reflection representing the type denoted by std::*UNARY*_t<T>, where T is the type or type alias represented by type |
| [🔗](#tab:meta.reflection.traits-row-7)<br>template<reflection_range R> info meta::*VARIADIC*(R&& args); | A reflection representing the type denoted by std::*VARIADIC*_t<T...>, where T... is the pack of types or type aliases whose elements are represented by the corresponding elements of args |
| [🔗](#tab:meta.reflection.traits-row-8)<br>template<reflection_range R> info meta::*VARIADIC*(info type, R&& args); | A reflection representing the type denoted by std::*VARIADIC*_t<T, U...>, 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 |
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6817)
[*Note [2](#note-2)*:
For those functions or function templates which return a reflection,
that reflection always represents a type and never a type alias[.](#4.sentence-1)
— *end note*]
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6823)
[*Note [3](#note-3)*:
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[.](#5.sentence-1)
Also, t == dealias(u) is true[.](#5.sentence-2)
— *end note*]
[🔗](#lib:rank)
`consteval size_t rank(info type);
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6838)
*Returns*: rank_v<T>,
where T is the type represented by dealias(type)[.](#6.sentence-1)
[🔗](#lib:extent)
`consteval size_t extent(info type, unsigned i = 0);
`
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6850)
*Returns*: extent_v<T, I>,
where T is the type represented by dealias(type) and I is a constant equal to i[.](#7.sentence-1)
[🔗](#lib:tuple_size)
`consteval size_t tuple_size(info type);
`
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6863)
*Returns*: tuple_size_v<T>,
where T is the type represented by dealias(type)[.](#8.sentence-1)
[🔗](#lib:tuple_element)
`consteval info tuple_element(size_t index, info type);
`
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6875)
*Returns*: A reflection representing
the type denoted by tuple_element_t<I, T>,
where T is the type represented by dealias(type) and I is a constant equal to index[.](#9.sentence-1)
[🔗](#lib:variant_size)
`consteval size_t variant_size(info type);
`
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6889)
*Returns*: variant_size_v<T>,
where T is the type represented by dealias(type)[.](#10.sentence-1)
[🔗](#lib:variant_alternative)
`consteval info variant_alternative(size_t index, info type);
`
[11](#11)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6901)
*Returns*: A reflection representing the type denoted byvariant_alternative_t<I, T>,
where T is the type represented by dealias(type) and I is a constant equal to index[.](#11.sentence-1)
[🔗](#lib:type_order)
`consteval strong_ordering type_order(info t1, info t2);
`
[12](#12)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L6915)
*Returns*: type_order_v<T1, T2>,
where T1 and T2 are the types
represented by dealias(t1) and dealias(t2), respectively[.](#12.sentence-1)