Skip to content

Commit 1973cd8

Browse files
committed
Improve P/R following reflector discussion preference
1 parent c15066e commit 1973cd8

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

xml/issue4259.xml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,48 @@ type, which in turn makes `S::size_type(std::size_t(-1))` not equal to `S::size_
2222
<p/>
2323
Do we want to restore the old return values?
2424
</p>
25+
26+
<superseded>
27+
<p>
28+
This wording is relative to <paper num="N5008"/>.
29+
</p>
30+
<ol>
31+
32+
<li><p>Modify <sref ref="[string.find]"/> as indicated:</p>
33+
34+
<blockquote>
35+
<pre>
36+
template&lt;class T&gt;
37+
constexpr size_type find(const T&amp; t, size_type pos = 0) const noexcept(<i>see below</i>);
38+
[&hellip;]
39+
template&lt;class T&gt;
40+
constexpr size_type find_last_not_of(const T&amp; t, size_type pos = npos) const noexcept(<i>see below</i>);
41+
</pre>
42+
<blockquote>
43+
<p>
44+
-2- <i>Constraints</i>: [&hellip;]
45+
<p/>
46+
-3- <i>Effects</i>: Let <tt><i>G</i></tt> be the name of the function. Equivalent to:
47+
</p>
48+
<blockquote><pre>
49+
basic_string_view&lt;charT, traits&gt; s = *this, sv = t;
50+
<del>return s.<i>G</i>(sv, pos);</del>
51+
<ins>if (auto result = s.<i>G</i>(sv, pos); result == size_t(-1))
52+
return npos;
53+
else
54+
return result;</ins>
55+
</pre></blockquote>
56+
</blockquote>
57+
</blockquote>
58+
</li>
59+
</ol>
60+
</superseded>
61+
62+
<note>2025-06-10, reflector discussion</note>
63+
<p>
64+
During reflector discussion of this issue there was a preference to adjust the
65+
proposed wording to use `s.npos` instead of `size_t(-1)`.
66+
</p>
2567
</discussion>
2668

2769
<resolution>
@@ -49,7 +91,7 @@ template&lt;class T&gt;
4991
<blockquote><pre>
5092
basic_string_view&lt;charT, traits&gt; s = *this, sv = t;
5193
<del>return s.<i>G</i>(sv, pos);</del>
52-
<ins>if (auto result = s.<i>G</i>(sv, pos); result == size_t(-1))
94+
<ins>if (auto result = s.<i>G</i>(sv, pos); result == s.npos)
5395
return npos;
5496
else
5597
return result;</ins>

0 commit comments

Comments
 (0)