Skip to content

Commit 88788b1

Browse files
committed
Tomasz provides wording for LWG4316
1 parent d73c75a commit 88788b1

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

xml/issue4316.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,91 @@ While the intent seems clear, this should be rephrased to be more technically co
4141
<p>
4242
Set priority to 1 after reflector poll.
4343
</p>
44+
45+
<note>2025-10-27; Tomasz provides wording.</note>
4446
</discussion>
4547

4648
<resolution>
49+
50+
<p>
51+
This wording is relative to <paper num="N5014"/>.
52+
</p>
53+
54+
<ol>
55+
56+
<li><p>Modify <sref ref="[meta.reflection.substitute]"/> as indicated:</p>
57+
58+
<blockquote>
59+
<blockquote>
60+
<p>
61+
<ins>-1- For value `x` of type `info`, and prvalue constant expression `X` that computes the
62+
reflection held by `x`, let <tt><i>TARG-SPLICE</i>(x)</tt> be:</ins>
63+
<ul>
64+
<li><ins>-1.1- <tt>template [: X :]</tt> if `is_template(x)` is `true`, otherwise</ins></li>
65+
<li><ins>-1.2- <tt>typename [: X :]</tt> if `is_type(x)` is `true`, otherwise</ins></li>
66+
<li><ins>-1.3- <tt>([: X :])</tt></ins></li>
67+
</ul>
68+
</p>
69+
</blockquote>
70+
71+
<pre>
72+
template&lt;reflection_range R = initializer_list&lt;info&gt;&gt;
73+
consteval bool can_substitute(info templ, R&amp;&amp; arguments);
74+
</pre>
75+
<blockquote>
76+
<p>
77+
-1- <del>Let `Z` be the template represented by `templ` and let `Args...` be a
78+
sequence of prvalue constant expressions that compute the reflections held by
79+
the elements of `arguments`, in order.</del>
80+
<ins>Let <i>n</i> be the number of elements in `arguments`, and <i>e<sub>i</sub></i>
81+
be the i<sup>th</sup> element of `arguments`.</ins>
82+
</p>
83+
<p>
84+
-2- <i>Returns</i>: `true` if <tt>Z&lt;<del>[:Args:]...</del><ins><i>TARG-SPLICE</i>(<i>e<sub>0</sub></i>),
85+
..., <i>TARG-SPLICE</i>(<i>e<sub>n-1</sub></i>)</ins>&gt;</tt> is a valid <i>template-id</i>
86+
(<sref ref="[temp.names]"/>) that does not name a function whose type contains an undeduced placeholder type.
87+
Otherwise, `false`.
88+
</p>
89+
<p>
90+
-3- <i>Throws</i>: `meta::exception` unless `templ` represents a template, and every reflection
91+
in `arguments` represents a construct usable as a template argument (<sref ref="[temp.arg]"/>).
92+
</p>
93+
<p>
94+
-4- [<i>Note</i>: If forming <tt>Z&lt;<del>[:Args:]...</del><ins><i>TARG-SPLICE</i>(<i>e<sub>0</sub></i>),
95+
..., <i>TARG-SPLICE</i>(<i>e<sub>n-1</sub></i>)</ins>&gt;</tt> leads to a failure outside of the immediate
96+
context, the program is ill-formed. &mdash; <i>end note</i>]
97+
</p>
98+
</blockquote>
99+
100+
<pre>
101+
template&lt;reflection_range R = initializer_list&lt;info&gt;&gt;
102+
consteval info substitute(info templ, R&amp;&amp; arguments);
103+
</pre>
104+
<blockquote>
105+
<p>
106+
-5- <del>Let `Z` be the template represented by `templ` and let `Args...` be a
107+
sequence of prvalue constant expressions that compute the reflections held by
108+
the elements of `arguments`, in order.</del>
109+
<ins>Let <i>n</i> be the number of elements in `arguments`, and <i>e<sub>i</sub></i>
110+
be the i<sup>th</sup> element of `arguments`.</ins>
111+
</p>
112+
<p>
113+
-6- <i>Returns</i>: <tt>^^Z&lt;<del>[:Args:]...</del><ins><i>TARG-SPLICE</i>(<i>e<sub>0</sub></i>)
114+
..., <i>TARG-SPLICE</i>(<i>e<sub>n-1</sub></i>)</ins>&gt;</tt>.</p>
115+
<p>
116+
-7- <i>Throws</i>: `meta::exception` unless `can_substitute(templ, arguments)` is `true`.
117+
</p>
118+
<p>
119+
-8- [<i>Note</i>: If forming <tt>Z&lt;<del>[:Args:]...</del><ins><i>TARG-SPLICE</i>(<i>e<sub>0</sub></i>),
120+
..., <i>TARG-SPLICE</i>(<i>e<sub>n-1</sub></i>)</ins>&gt;</tt> leads to a failure outside of the immediate
121+
context, the program is ill-formed. &mdash; <i>end note</i>]
122+
</p>
123+
</blockquote>
124+
125+
</blockquote>
126+
</li>
127+
</ol>
128+
47129
</resolution>
48130

49131
</issue>

0 commit comments

Comments
 (0)