Title
Clarify element initialization for meta::reflect_constant_array
Status
wp
Section
[meta.define.static]
Submitter
Tomasz Kamiński

Created on 2025-10-27.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-11.10:48:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [meta.define.static] as indicated:

    template<ranges::input_range R>
      consteval info reflect_constant_array(R&& r);
    

    -8- Let T be ranges::range_value_t<R> and ei be static_cast<T>(*iti), where iti is an iterator to the ith element of `r`.

    -9- Mandates: T is a structural type ([temp.param]), is_constructible_v<T, ranges::range_reference_t<R>> is true, and is_copy_constructible_v<T> is true T satisfies copy_constructible.

    -10- Let V be the pack of values of type `info` of the same size as r, where the ith element is reflect_constant(ei), where ei is an iterator to the ith element of r.

    […]

    -13- Throws: Any exception thrown by the evaluation of any ei, or `meta::exception` unlessif evaluation of any reflect_constant(eei) would exit via an exception is a constant subexpression for every element `e` of `r`.

Date: 2025-11-11.10:48:55

[ Kona 2025-11-08; Status changed: Immediate → WP. ]

Date: 2025-11-04.23:55:21

[ Kona 2025-11-04; approved by LWG. Status changed: New → Immediate. ]

Date: 2025-11-04.23:46:41
Addresses US 120-181 and US 121-182

[meta.reflection.array] p10 Clarify ei type. It is not clear what ei is when proxy references are involved.

[meta.reflection.array] Clarify copy-initialization vs. direct-initialization use The initialization of P uses copy-initialization but the Mandates clause uses direct-initialization.

This wording is relative to N5014.

  1. Modify [meta.define.static] as indicated:

    template<ranges::input_range R>
      consteval info reflect_constant_array(R&& r);
    

    -8- Let T be ranges::range_value_t<R>.

    -9- Mandates: T is a structural type ([temp.param]), is_constructible_v<T, ranges::range_reference_t<R>> is true, and is_copy_constructible_v<T> is true T satisfies copy_constructible.

    -10- Let V be the pack of values of type info of the same size as r, where the ith element is reflect_constant(eistatic_cast<T>(*iti)), where eiiti is an iterator to the ith element of r.

    […]

History
Date User Action Args
2025-11-11 10:48:55adminsetmessages: + msg15687
2025-11-11 10:48:55adminsetstatus: immediate -> wp
2025-11-04 23:55:21adminsetmessages: + msg15508
2025-11-04 23:55:21adminsetstatus: new -> immediate
2025-10-27 10:12:39adminsetmessages: + msg15462
2025-10-27 00:00:00admincreate