|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4432" status="New"> |
| 5 | +<title>Clarify element initialization for <tt>meta::reflect_constant_array</tt></title> |
| 6 | +<section> |
| 7 | +<sref ref="[meta.reflection.array]"/> |
| 8 | +</section> |
| 9 | +<submitter>Tomasz Kamiński</submitter> |
| 10 | +<date>27 Oct 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<b>Addresses US 120-181 and US 121-182</b> |
| 15 | +<p> |
| 16 | +<sref ref="[meta.reflection.array]"/> p10 Clarify <i>e<sub>i</sub></i> type. |
| 17 | +It is not clear what <i>e<sub>i</sub></i> is when proxy references are involved. |
| 18 | +</p> |
| 19 | +<p> |
| 20 | +<sref ref="[meta.reflection.array]"/> Clarify copy-initialization vs. direct-initialization use |
| 21 | +The initialization of <tt>P</tt> uses copy-initialization but the Mandates clause uses direct-initialization. |
| 22 | +</p> |
| 23 | +</discussion> |
| 24 | + |
| 25 | +<resolution> |
| 26 | +<p> |
| 27 | +This wording is relative to <paper num="N5014"/>. |
| 28 | +</p> |
| 29 | + |
| 30 | +<ol> |
| 31 | + |
| 32 | +<li><p>Modify <sref ref="[meta.reflection.array]"/> as indicated:</p> |
| 33 | + |
| 34 | +<pre> |
| 35 | +template<ranges::input_range R> |
| 36 | + consteval info reflect_constant_array(R&& r); |
| 37 | +</pre> |
| 38 | +<blockquote> |
| 39 | +<p>-8- Let <tt>T</tt> be <tt>ranges::range_value_t<R></tt>.</p> |
| 40 | +<p>-9- <i>Mandates</i>: |
| 41 | + <tt>T</tt> is a structural type (<sref ref="[temp.param]"/>), |
| 42 | + <tt>is_constructible_v<T, ranges::range_reference_t<R>></tt> is <tt>true</tt>, and |
| 43 | + <del><tt>is_copy_constructible_v<T></tt> is <tt>true</tt></del> |
| 44 | + <ins><tt>T</tt> statisfies <tt>copy_constructible</tt></ins>.</p> |
| 45 | +<p>-10- Let <tt>V</tt> be the pack of values of type info of the same size as <tt>r</tt>, |
| 46 | +where the <i>i<sup>th</sup></i> element is |
| 47 | +<tt>reflect_constant(<del><i>e<sub>i</sub></i></del><ins>static_cast<T>(*<i>it<sub>i</sub></i>)</ins>)</tt>, |
| 48 | +where <i><del>e<sub>i</sub></del><ins>it<sub>i</sub></ins></i> is <ins>an iterator to</ins> the ith element of <tt>r</tt>. |
| 49 | +</p> |
| 50 | +<p>[…]</p> |
| 51 | +</blockquote> |
| 52 | +</li> |
| 53 | +</ol> |
| 54 | + |
| 55 | +</resolution> |
| 56 | + |
| 57 | +</issue> |
0 commit comments