You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: issue4389.html
+30-12Lines changed: 30 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@
64
64
<p><em>This page is a snapshot from the LWG issues list, see the <ahref="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <ahref="lwg-active.html#New">New</a> status.</em></p>
65
65
<h3id="4389"><ahref="lwg-active.html#4389">4389</a>. <codeclass='backtick'>ranges::for_each</code> possibly behaves differently from range-based <codeclass='backtick'>for</code></h3>
-2- Given a subexpression <codeclass='backtick'>E</code> with type <codeclass='backtick'>T</code>, let <codeclass='backtick'>t</code> be an lvalue that denotes the reified object for <codeclass='backtick'>E</code>. Then:
119
119
</p>
120
120
<olstyle="list-style-type: none">
121
-
<li><p>(2.1) — […]</p></li>
122
-
<li><p>(2.2) — […]</p></li>
123
-
<li><p>(2.3) — […]</p></li>
124
-
<li><p>(2.4) — […]</p></li>
121
+
<li><p>(2.1) — If <codeclass='backtick'>E</code> is an rvalue and <code>enable_borrowed_range<remove_cv_t<T>></code> is
122
+
<codeclass='backtick'>false</code>, <codeclass='backtick'>ranges::begin(E)</code> is ill-formed.</p></li>
123
+
<li><p>(2.2) — Otherwise, if <codeclass='backtick'>T</code> is an array type (9.3.4.5 <ahref="https://wg21.link/dcl.array">[dcl.array]</a>) and
124
+
<code>remove_all_extents_t<T></code> is an incomplete type, <codeclass='backtick'>ranges::begin(E)</code> is
125
+
ill-formed with no diagnostic required.</p></li>
126
+
<li><p>(2.3) — Otherwise, if <codeclass='backtick'>T</code> is an array type, <codeclass='backtick'>ranges::begin(E)</code> is
127
+
expression-equivalent to <codeclass='backtick'>t + 0</code>.</p></li>
128
+
<li><p>(2.4) — Otherwise, if <codeclass='backtick'>auto(t.begin())</code> is a valid expression whose type models
129
+
<codeclass='backtick'>input_or_output_iterator</code>, <codeclass='backtick'>ranges::begin(E)</code> is expression-equivalent to <codeclass='backtick'>auto(t.begin())</code>.</p></li>
125
130
<li><p><ins>(2.?) — Otherwise, if <code>remove_cvref_t<T></code> is a class type and search for
126
131
<codeclass='backtick'>begin</code> in the scope of that class finds at least one declaration, <codeclass='backtick'>ranges::begin(E)</code> is ill-formed.</ins></p></li>
127
-
<li><p>(2.5) — […]</p></li>
132
+
<li><p>(2.5) — Otherwise, if <codeclass='backtick'>T</code> is a class or enumeration type and <codeclass='backtick'>auto(begin(t))</code>
133
+
is a valid expression whose type models <codeclass='backtick'>input_or_output_iterator</code> where the meaning of <codeclass='backtick'>begin</code>
134
+
is established as-if by performing argument-dependent lookup only (6.5.4 <ahref="https://wg21.link/basic.lookup.argdep">[basic.lookup.argdep]</a>),
135
+
then <codeclass='backtick'>ranges::begin(E)</code> is expression-equivalent to that expression.</p></li>
128
136
<li><p>(2.6) — Otherwise, <codeclass='backtick'>ranges::begin(E)</code> is ill-formed.</p></li>
-2- Given a subexpression <codeclass='backtick'>E</code> with type <codeclass='backtick'>T</code>, let <codeclass='backtick'>t</code> be an lvalue that denotes the reified object for <codeclass='backtick'>E</code>. Then:
138
146
</p>
139
147
<olstyle="list-style-type: none">
140
-
<li><p>(2.1) — […]</p></li>
141
-
<li><p>(2.2) — […]</p></li>
142
-
<li><p>(2.3) — […]</p></li>
143
-
<li><p>(2.4) — […]</p></li>
144
-
<li><p>(2.5) — […]</p></li>
148
+
<li><p>(2.1) — If <codeclass='backtick'>E</code> is an rvalue and <code>enable_borrowed_range<remove_cv_t<T>></code>
149
+
is <codeclass='backtick'>false</code>, <codeclass='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
150
+
<li><p>(2.2) — Otherwise, if <codeclass='backtick'>T</code> is an array type (9.3.4.5 <ahref="https://wg21.link/dcl.array">[dcl.array]</a>) and
151
+
<code>remove_all_extents_t<T></code> is an incomplete type, <codeclass='backtick'>ranges::end(E)</code> is ill-formed
152
+
with no diagnostic required.</p></li>
153
+
<li><p>(2.3) — Otherwise, if <codeclass='backtick'>T</code> is an array of unknown bound, <codeclass='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
154
+
<li><p>(2.4) — Otherwise, if <codeclass='backtick'>T</code> is an array, <codeclass='backtick'>ranges::end(E)</code> is expression-equivalent to
155
+
<code>t + extent_v<T></code>.</p></li>
156
+
<li><p>(2.5) — Otherwise, if <codeclass='backtick'>auto(t.end())</code> is a valid expression whose type models
157
+
<code>sentinel_for<iterator_t<T>></code> then <codeclass='backtick'>ranges::end(E)</code> is expression-equivalent to
<li><p><ins>(2.?) — Otherwise, if <code>remove_cvref_t<T></code> is a class type and search for
146
160
<codeclass='backtick'>end</code> in the scope of that class finds at least one declaration, <codeclass='backtick'>ranges::end(E)</code> is ill-formed.</ins></p></li>
147
-
<li><p>(2.6) — […]</p></li>
161
+
<li><p>(2.6) — Otherwise, if <codeclass='backtick'>T</code> is a class or enumeration type and <codeclass='backtick'>auto(end(t))</code>
162
+
is a valid expression whose type models <code>sentinel_for<iterator_t<T>></code>
163
+
where the meaning of end is established as-if by performing argument-dependent
164
+
lookup only (6.5.4 <ahref="https://wg21.link/basic.lookup.argdep">[basic.lookup.argdep]</a>), then <codeclass='backtick'>ranges::end(E)</code> is expression-equivalent
165
+
to that expression.</p></li>
148
166
<li><p>(2.7) — Otherwise, <codeclass='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
-2- Given a subexpression <code class='backtick'>E</code> with type <code class='backtick'>T</code>, let <code class='backtick'>t</code> be an lvalue that denotes the reified object for <code class='backtick'>E</code>. Then:
85663
85663
</p>
85664
85664
<ol style="list-style-type: none">
85665
-
<li><p>(2.1) — […]</p></li>
85666
-
<li><p>(2.2) — […]</p></li>
85667
-
<li><p>(2.3) — […]</p></li>
85668
-
<li><p>(2.4) — […]</p></li>
85665
+
<li><p>(2.1) — If <code class='backtick'>E</code> is an rvalue and <code>enable_borrowed_range<remove_cv_t<T>></code> is
85666
+
<code class='backtick'>false</code>, <code class='backtick'>ranges::begin(E)</code> is ill-formed.</p></li>
85667
+
<li><p>(2.2) — Otherwise, if <code class='backtick'>T</code> is an array type (9.3.4.5 <a href="https://wg21.link/dcl.array">[dcl.array]</a>) and
85668
+
<code>remove_all_extents_t<T></code> is an incomplete type, <code class='backtick'>ranges::begin(E)</code> is
85669
+
ill-formed with no diagnostic required.</p></li>
85670
+
<li><p>(2.3) — Otherwise, if <code class='backtick'>T</code> is an array type, <code class='backtick'>ranges::begin(E)</code> is
85671
+
expression-equivalent to <code class='backtick'>t + 0</code>.</p></li>
85672
+
<li><p>(2.4) — Otherwise, if <code class='backtick'>auto(t.begin())</code> is a valid expression whose type models
85673
+
<code class='backtick'>input_or_output_iterator</code>, <code class='backtick'>ranges::begin(E)</code> is expression-equivalent to <code class='backtick'>auto(t.begin())</code>.</p></li>
85669
85674
<li><p><ins>(2.?) — Otherwise, if <code>remove_cvref_t<T></code> is a class type and search for
85670
85675
<code class='backtick'>begin</code> in the scope of that class finds at least one declaration, <code class='backtick'>ranges::begin(E)</code> is ill-formed.</ins></p></li>
85671
-
<li><p>(2.5) — […]</p></li>
85676
+
<li><p>(2.5) — Otherwise, if <code class='backtick'>T</code> is a class or enumeration type and <code class='backtick'>auto(begin(t))</code>
85677
+
is a valid expression whose type models <code class='backtick'>input_or_output_iterator</code> where the meaning of <code class='backtick'>begin</code>
85678
+
is established as-if by performing argument-dependent lookup only (6.5.4 <a href="https://wg21.link/basic.lookup.argdep">[basic.lookup.argdep]</a>),
85679
+
then <code class='backtick'>ranges::begin(E)</code> is expression-equivalent to that expression.</p></li>
85672
85680
<li><p>(2.6) — Otherwise, <code class='backtick'>ranges::begin(E)</code> is ill-formed.</p></li>
-2- Given a subexpression <code class='backtick'>E</code> with type <code class='backtick'>T</code>, let <code class='backtick'>t</code> be an lvalue that denotes the reified object for <code class='backtick'>E</code>. Then:
85682
85690
</p>
85683
85691
<ol style="list-style-type: none">
85684
-
<li><p>(2.1) — […]</p></li>
85685
-
<li><p>(2.2) — […]</p></li>
85686
-
<li><p>(2.3) — […]</p></li>
85687
-
<li><p>(2.4) — […]</p></li>
85688
-
<li><p>(2.5) — […]</p></li>
85692
+
<li><p>(2.1) — If <code class='backtick'>E</code> is an rvalue and <code>enable_borrowed_range<remove_cv_t<T>></code>
85693
+
is <code class='backtick'>false</code>, <code class='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
85694
+
<li><p>(2.2) — Otherwise, if <code class='backtick'>T</code> is an array type (9.3.4.5 <a href="https://wg21.link/dcl.array">[dcl.array]</a>) and
85695
+
<code>remove_all_extents_t<T></code> is an incomplete type, <code class='backtick'>ranges::end(E)</code> is ill-formed
85696
+
with no diagnostic required.</p></li>
85697
+
<li><p>(2.3) — Otherwise, if <code class='backtick'>T</code> is an array of unknown bound, <code class='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
85698
+
<li><p>(2.4) — Otherwise, if <code class='backtick'>T</code> is an array, <code class='backtick'>ranges::end(E)</code> is expression-equivalent to
85699
+
<code>t + extent_v<T></code>.</p></li>
85700
+
<li><p>(2.5) — Otherwise, if <code class='backtick'>auto(t.end())</code> is a valid expression whose type models
85701
+
<code>sentinel_for<iterator_t<T>></code> then <code class='backtick'>ranges::end(E)</code> is expression-equivalent to
<li><p><ins>(2.?) — Otherwise, if <code>remove_cvref_t<T></code> is a class type and search for
85690
85704
<code class='backtick'>end</code> in the scope of that class finds at least one declaration, <code class='backtick'>ranges::end(E)</code> is ill-formed.</ins></p></li>
85691
-
<li><p>(2.6) — […]</p></li>
85705
+
<li><p>(2.6) — Otherwise, if <code class='backtick'>T</code> is a class or enumeration type and <code class='backtick'>auto(end(t))</code>
85706
+
is a valid expression whose type models <code>sentinel_for<iterator_t<T>></code>
85707
+
where the meaning of end is established as-if by performing argument-dependent
85708
+
lookup only (6.5.4 <a href="https://wg21.link/basic.lookup.argdep">[basic.lookup.argdep]</a>), then <code class='backtick'>ranges::end(E)</code> is expression-equivalent
85709
+
to that expression.</p></li>
85692
85710
<li><p>(2.7) — Otherwise, <code class='backtick'>ranges::end(E)</code> is ill-formed.</p></li>
Copy file name to clipboardExpand all lines: lwg-index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ <h1>Index by Section</h1>
66
66
<p>This document is the Index by Section for the <a href="lwg-active.html">Library Active Issues List</a>, <a href="lwg-defects.html">Library Defect Reports and Accepted Issues</a>, and <a href="lwg-closed.html">Library Closed Issues List</a>.</p>
67
67
<h2>Index by Section</h2>
68
68
<p><a href="lwg-index-open.html">(view only non-Ready open issues)</a></p>
<td id="4389"><a href="lwg-active.html#4389" title="ranges::for_each possibly behaves differently from range-based for (Status: New)">4389</a><sup><a href="https://cplusplus.github.io/LWG/issue4389">(i)</a></sup></td>
399
+
<td><a href="lwg-active.html#New">New</a></td>
400
+
<td>25.4.2 [range.range]</td>
401
+
<td><code class='backtick'>ranges::for_each</code> possibly behaves differently from range-based <code class='backtick'>for</code></td>
402
+
<td>Yes</td>
403
+
<td></td>
404
+
<td></td>
405
+
</tr>
406
+
<tr>
398
407
<td id="4322"><a href="lwg-active.html#4322" title="Problematic Constraints on incomplete types in indirect and polymorphic (Status: New)">4322</a><sup><a href="https://cplusplus.github.io/LWG/issue4322">(i)</a></sup></td>
0 commit comments