From 6758557291a0d1ca942ce1dab4e23cf070e06315 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Tue, 5 Nov 2024 10:21:27 -0600 Subject: [PATCH] Re-adding the complete requirement --- 2996_reflection/p2996r8.html | 103 ++++++++++++++++++---------------- 2996_reflection/reflection.md | 3 +- 2 files changed, 56 insertions(+), 50 deletions(-) diff --git a/2996_reflection/p2996r8.html b/2996_reflection/p2996r8.html index 14427ff0..df0f88ce 100644 --- a/2996_reflection/p2996r8.html +++ b/2996_reflection/p2996r8.html @@ -8914,8 +8914,13 @@

true for every rK in -mdescrs, and +mdescrs,
  • (5.3) +the type represented by type_of(rK) +is a complete type for every +rK in +mdescrs, and
  • +
  • (5.4) for every pair 0 ≤ K < 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 @@

    rk in mdescrs.

    -

    7 +

    7 Effects: Produces an injected declaration D ([expr.const]) that provides a definition for C with properties as follows:

      -
    • (7.1) +
    • (7.1) The target scope of D is the scope to which C belongs ([basic.scope.scope]).
    • -
    • (7.2) +
    • (7.2) The locus of D follows immediately after the manifestly constant-evaluated expression currently under evaluation.
    • -
    • (7.3) +
    • (7.3) If C is a specialization of a class template T, then D is is an explicit specialization of T.
    • -
    • (7.4) +
    • (7.4) D contains a public non-static data member corresponding to each reflection value rK in @@ -8969,28 +8974,28 @@

      rK precedes the declaration of rL.

    • -
    • (7.5) +
    • (7.5) The non-static data member corresponding to each rK is declared with the type or typedef-name represented by tK.
    • -
    • (7.6) +
    • (7.6) Non-static data members corresponding to reflections rK for which oK.no_unique_address is true are declared with the attribute [[no_unique_address]].
    • -
    • (7.7) +
    • (7.7) Non-static data members corresponding to reflections rK for which oK.bit_width contains a value are declared as bit-fields whose width is that value.
    • -
    • (7.8) +
    • (7.8) Non-static data members corresponding to reflections rK for which oK.alignment contains a value are declared with the alignment-specifier alignas(oK.alignment).
    • -
    • (7.9) +
    • (7.9) Non-static data members corresponding to reflections rK are declared with names determined as follows: @@ -9005,16 +9010,16 @@

      u8identifier_of(rK) in UTF-8.

  • -
  • (7.10) +
  • (7.10) If 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.
  • -
  • (7.11) +
  • (7.11) If 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.

    @@ -9024,10 +9029,10 @@

    [meta.reflec
    -

    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 contains type, a call to @@ -9048,7 +9053,7 @@

    [m
    -

    1 +

    1 For any type or typedef-name T, for each function std::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);

    -

    2

    +

    2

    Example 1:
    namespace std::meta {
    @@ -9096,7 +9101,7 @@ 

    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::TRAIT_type @@ -9118,7 +9123,7 @@

    [meta.ref
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::UNARY-TRAIT_type @@ -9128,7 +9133,7 @@

    [meta.ref or std::meta::UNARY-TRAIT(^T) equals the value of the corresponding type property std::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 property std::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>, where T is the type represented by type.

    consteval size_t extent(info type, unsigned i = 0);
    -

    2 +

    2 Effects: Equivalent to return std::extent_v<T, i>, where T is the type represented by type.

    @@ -9242,10 +9247,10 @@

    [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 relation std::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 relation std::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 type int 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 function std::meta::MOD @@ -9350,7 +9355,7 @@

    [m
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::MOD @@ -9368,7 +9373,7 @@

    [meta.
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::MOD @@ -9385,7 +9390,7 @@

    [meta.
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::MOD @@ -9402,7 +9407,7 @@

    [met
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::MOD @@ -9429,7 +9434,7 @@

    [m
    -

    1 +

    1 For any type or typedef-name T, for each function std::meta::type_MOD @@ -9437,7 +9442,7 @@

    [m std::meta::type_MOD(^T) returns the reflection of the corresponding type std::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 type std::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);

    -

    4

    +

    4

    Example 1:
    // example implementation
    @@ -9491,7 +9496,7 @@ 

    -

    1 +

    1 For any type or typedef-name T, for each function std::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}