This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4432. Clarify element initialization for meta::reflect_constant_array

Section: 21.4.15 [meta.reflection.array] Status: New Submitter: Tomasz KamiƄski Opened: 2025-10-27 Last modified: 2025-10-27

Priority: Not Prioritized

View other active issues in [meta.reflection.array].

View all other issues in [meta.reflection.array].

View all issues with New status.

Discussion:

Addresses US 120-181 and US 121-182

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

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

Proposed resolution:

This wording is relative to N5014.

  1. Modify 21.4.15 [meta.reflection.array] 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 (13.2 [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.

    […]