Skip to content

Commit 069b6f5

Browse files
committed
Update 4249 with simpler P/R from Hewill Kang on reflector
1 parent fffae08 commit 069b6f5

File tree

1 file changed

+63
-3
lines changed

1 file changed

+63
-3
lines changed

xml/issue4249.xml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ at the end of the source range when incrementing the outer iterator,
8484
which by definition means that iterating through the inner range
8585
<i>didn't</i> exhaust it."
8686
</p>
87-
</discussion>
88-
89-
<resolution>
87+
<superseded>
9088
<p>
9189
This wording is relative to <paper num="N5008"/>.
9290
</p>
@@ -196,6 +194,68 @@ else</ins>
196194
</li>
197195

198196
</ol>
197+
</superseded>
198+
199+
<note>2025-10-21; Hewill Kang provides simpler wording</note>
200+
201+
</discussion>
202+
203+
<resolution>
204+
<p>
205+
This wording is relative to <paper num="N5014"/>.
206+
</p>
207+
208+
<ol>
209+
210+
<li><p>Modify <sref ref="[range.lazy.split.outer]"/> as indicated:</p>
211+
212+
<blockquote>
213+
<pre>
214+
constexpr <i>outer-iterator</i>&amp; operator++();
215+
</pre>
216+
<blockquote>
217+
<p>
218+
-6- <i>Effects:</i> Equivalent to:
219+
</p>
220+
<blockquote><pre>
221+
const auto end = ranges::end(<i>parent_</i>-&gt;<i>base_</i>);
222+
if (<i>current</i> == end) {
223+
<i>trailing_empty_</i> = false;
224+
return <code>*this</code>;
225+
}
226+
const auto [pbegin, pend] = subrange{<i>parent_</i>-&gt;<i>pattern_</i>};
227+
if (pbegin == pend) ++<i>current</i>;
228+
else if constexpr (<i>tiny-range</i>&lt;Pattern&gt;) {
229+
<i>current</i> = ranges::find(std::move(<i>current</i>), end, *pbegin);
230+
if (<i>current</i> != end) {
231+
++<i>current</i>;
232+
if (<i>current</i> == end)
233+
<i>trailing_empty_</i> = true;
234+
<ins>else if constexpr (!forward_range&lt;V&gt;)
235+
<i>trailing_empty_</i> = true;</ins>
236+
}
237+
}
238+
else {
239+
do {
240+
auto [b, p] = ranges::mismatch(<i>current</i>, end, pbegin, pend);
241+
if (p == pend) {
242+
<i>current</i> = b;
243+
if (<i>current</i> == end)
244+
<i>trailing_empty_</i> = true;
245+
break; <i>// The pattern matched; skip it</i>
246+
}
247+
} while (++<i>current</i> != end);
248+
}
249+
return *this;
250+
</pre></blockquote>
251+
</blockquote>
252+
</blockquote>
253+
254+
</li>
255+
256+
</ol>
257+
258+
199259
</resolution>
200260

201261
</issue>

0 commit comments

Comments
 (0)