From 6758557291a0d1ca942ce1dab4e23cf070e06315 Mon Sep 17 00:00:00 2001
From: Barry Revzin true for
every
rK
in
-mdescrs
, and
+mdescrs
,
type_of(rK)
+is a complete type for every
+rK
in
+mdescrs
, andK
<
L
< mdescrs.size()
,
if has_identifier(rK) && has_identifier(rL)
@@ -8926,7 +8931,7 @@ C could be a class
template specialization for which there is no reachable
definition. — end note ]
6 +
6
Let
{tk
}
be a sequence of reflections and
@@ -8938,26 +8943,26 @@
mdescrs
.
-7 +
7
Effects: Produces an injected declaration
D
([expr.const]) that
provides a definition for C
with properties as follows:
D
is
the scope to which C
belongs ([basic.scope.scope]).D
follows
immediately after the manifestly constant-evaluated expression currently
under evaluation.C
is a specialization of
a class template T
, then
D
is is an explicit
specialization of T
.D
contains a public
non-static data member corresponding to each reflection value
rK
in
@@ -8969,28 +8974,28 @@ rL
.rK
is declared with the
type or typedef-name
represented by
tK
.rK
for which oK.no_unique_address
is true
are
declared with the attribute [[no_unique_address]]
.rK
for which oK.bit_width
contains a value are declared as bit-fields whose width is that
value.rK
for which oK.alignment
contains a value are declared with the
alignment-specifier
alignas(oK.alignment)
.rK
are declared with
names determined as follows:
@@ -9005,16 +9010,16 @@ C
is a union type for
which any of its members are not trivially default constructible, then
it has a user-provided default constructor which has no effect.C
is a union type for
which any of its members are not trivially default destructible, then it
has a user-provided default destructor which has no effect.8 +
8
Returns: class_type
.
-1 +
1 Subclause [meta.reflection.unary] contains consteval functions that may be used to query the properties of a type at compile time.
-2 +
2 For each function taking an argument of type
meta::info
whose name containstype
, a call to @@ -9048,7 +9053,7 @@[m
-- +1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::TRAIT_type
@@ -9070,7 +9075,7 @@[m consteval bool is_class_type(info type); consteval bool is_function_type(info type); consteval bool is_reflection_type(info type);
[ Example 1:@@ -9096,7 +9101,7 @@ namespace std::meta {
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::TRAIT_type
@@ -9118,7 +9123,7 @@[meta.ref
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::UNARY-TRAIT_type
@@ -9128,7 +9133,7 @@[meta.ref or
std::meta::UNARY-TRAIT(^T)
equals the value of the corresponding type propertystd::UNARY-TRAIT_v<T>
as specified in 21.3.5.4 [meta.unary.prop]. -2 +
2 For any types or
typedef-names
T
and @@ -9139,7 +9144,7 @@[meta.ref or
std::meta::BINARY-TRAIT(^T, ^U)
equals the value of the corresponding type propertystd::BINARY-TRAIT_v<T, U>
as specified in 21.3.5.4 [meta.unary.prop]. -3 +
3 For any type or
typedef-name
T
, pack of types or @@ -9225,12 +9230,12 @@
-consteval size_t rank(info type);
1 +
1 Effects: Equivalent to
return std::rank_v<T>
, whereT
is the type represented bytype
.-consteval size_t extent(info type, unsigned i = 0);
2 +
2 Effects: Equivalent to
@@ -9242,10 +9247,10 @@return std::extent_v<T, i>
, whereT
is the type represented bytype
.[meta.reflection.
--1 +
1 The consteval functions specified in this clause may be used to query relationships between types at compile time.
-2 +
2 For any types or
typedef-name
T
and @@ -9254,7 +9259,7 @@[meta.reflection.
std::meta::REL_type(^T, ^U)
equals the value of the corresponding type relationstd::REL_v<T, U>
as specified in 21.3.7 [meta.rel]. -3 +
3 For any type or
typedef-name
T
, pack of types or @@ -9266,7 +9271,7 @@[meta.reflection.
std::meta::VARIADIC-REL_type(^T, r)
equals the value of the corresponding type relationstd::VARIADIC-REL_v<T, U...>
as specified in 21.3.7 [meta.rel]. -4 +
4 For any types or
typedef-names
T
and @@ -9295,7 +9300,7 @@[meta.reflection. 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);
5 +
5 [ Note 1: If
t
is a reflection of the typeint
and @@ -9317,7 +9322,7 @@
-1 +
1 Subclause [meta.reflection.trans] contains consteval functions that may be used to transform one type to another following some predefined rule.
@@ -9329,7 +9334,7 @@
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::MOD
@@ -9350,7 +9355,7 @@[m
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::MOD
@@ -9368,7 +9373,7 @@[meta.
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::MOD
@@ -9385,7 +9390,7 @@[meta.
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::MOD
@@ -9402,7 +9407,7 @@[met
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::MOD
@@ -9429,7 +9434,7 @@[m
-- +1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::type_MOD
@@ -9437,7 +9442,7 @@[m
std::meta::type_MOD(^T)
returns the reflection of the corresponding typestd::MOD_t<T>
as specified in 21.3.8.7 [meta.trans.other]. -2 +
2 For any pack of types or
typedef-names
T...
and @@ -9447,7 +9452,7 @@[m defined in this clause,
std::meta::VARIADIC-MOD(r)
returns the reflection of the corresponding typestd::VARIADIC-MOD_t<T...>
as specified in 21.3.8.7 [meta.trans.other]. -3 +
3 For any type or
typedef-name
T
, pack of types or @@ -9469,7 +9474,7 @@[m consteval info invoke_result(info type, R&& type_args); consteval info unwrap_reference(info type); consteval info unwrap_ref_decay(info type);
[ Example 1:// example implementation @@ -9491,7 +9496,7 @@
-1 +
1 For any type or
typedef-name
T
, for each functionstd::meta::UNARY-TRAIT
@@ -9499,7 +9504,7 @@std::meta::UNARY-TRAIT(^T) equals the value of the corresponding property
std::UNARY-TRAIT_v<T>
as defined in 22.4 [tuple] or 22.6 [variant]. -2 +
2 For any type or
typedef-name
T
and value @@ -9523,7 +9528,7 @@22.15.3 22.15.3 [bit.cast]/3:
-3 +
3 Remarks: This function is constexpr if and only if
To
,From
, and the types of all @@ -9531,27 +9536,27 @@22.15.3 From are types
T
such that: diff --git a/2996_reflection/reflection.md b/2996_reflection/reflection.md index 1ace0162..26e50c73 100644 --- a/2996_reflection/reflection.md +++ b/2996_reflection/reflection.md @@ -5424,7 +5424,8 @@ consteval bool is_data_member_spec(info r); - the reachable definition of `$C$` is an injected declaration produced by an evaluation of `define_aggregate`, - `$C$` has as many data members as `mdescrs` has elements, and - each `$K$`^th^ reflection value in `mdescrs` describes a data member with all of the same properties as the `$K$`^th^ data member of `$C$`. -- [#.#]{.pnum} `is_data_member_spec(@$r$~$K$~@)` is `true` for every `@$r$~$K$~@` in `mdescrs`, and +- [#.#]{.pnum} `is_data_member_spec(@$r$~$K$~@)` is `true` for every `@$r$~$K$~@` in `mdescrs`, +- [#.#]{.pnum} the type represented by `type_of(@$r$~$K$~@)` is a complete type for every `@$r$~$K$~@` in `mdescrs`, and - [#.#]{.pnum} for every pair 0 ≤ `$K$` < `$L$` < `mdescrs.size()`, if `has_identifier(@$r$~$K$~@) && has_identifier(@$r$~$L$~@)` is `true`, then `u8identifier_of(@$r$~$K$~@) != u8identifier_of(@$r$~$L$~@)`. [`$C$` could be a class template specialization for which there is no reachable definition.]{.note}