<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2946: LWG 2758's resolution missed further corrections</title>
<meta property="og:title" content="Issue 2946: LWG 2758's resolution missed further corrections">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2946.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++20">C++20</a> status.</em></p>
<h3 id="2946"><a href="lwg-defects.html#2946">2946</a>. LWG 2758's resolution missed further corrections</h3>
<p><b>Section:</b> 27.4.3.3 <a href="https://wg21.link/string.cons">[string.cons]</a>, 27.4.3.7.2 <a href="https://wg21.link/string.append">[string.append]</a>, 27.4.3.7.3 <a href="https://wg21.link/string.assign">[string.assign]</a>, 27.4.3.8 <a href="https://wg21.link/string.ops">[string.ops]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> Daniel Kr&uuml;gler <b>Opened:</b> 2017-03-17 <b>Last modified:</b> 2021-02-25</p>
<p><b>Priority: </b>2
</p>
<p><b>View all other</b> <a href="lwg-index.html#string.cons">issues</a> in [string.cons].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p>
LWG <a href="lwg-defects.html#2758" title="std::string{}.assign(&quot;ABCDE&quot;, 0, 1) is ambiguous (Status: C++17)">2758</a><sup><a href="https://cplusplus.github.io/LWG/issue2758" title="Latest snapshot">(i)</a></sup> corrected newly introduced ambiguities of <code>std::string::assign</code> and other functions 
that got new overloads taking a <code>basic_string_view</code> as argument, but the assignment operator of 
<code>basic_string</code> and other functions taking a parameter of type <code>basic_string_view&lt;charT, traits&gt;</code> 
were not corrected. Similar to the previous issue the following operations lead now to an ambiguity as well:
 </p>

<blockquote>
<pre>
#include &lt;string&gt;

int main() 
{
  std::string s({"abc", 1});
  s = {"abc", 1};
  s += {"abc", 1};
  s.append({"abc", 1});
  s.assign({"abc", 1});
  s.insert(0, {"abc", 1});
  s.replace(0, 1, {"abc", 1});
  s.replace(s.cbegin(), s.cbegin(), {"abc", 1});
  s.find({"abc", 1});
  s.rfind({"abc", 1});
  s.find_first_of({"abc", 1});
  s.find_last_of({"abc", 1});
  s.find_first_not_of({"abc", 1});
  s.find_last_not_of({"abc", 1});
  s.compare({"abc", 1});
  s.compare(0, 1, {"abc", 1});
}
</pre>
</blockquote>

<p>
The right fix is to convert <em>all</em> member functions taken a <code>basic_string_view&lt;charT, traits&gt;</code> parameter 
into constrained function templates.
<p/>
When doing so, it turns out that there occurs an additional problem: The functions that had been massaged by LWG 
<a href="lwg-defects.html#2758" title="std::string{}.assign(&quot;ABCDE&quot;, 0, 1) is ambiguous (Status: C++17)">2758</a><sup><a href="https://cplusplus.github.io/LWG/issue2758" title="Latest snapshot">(i)</a></sup> are all functions that are not specified to be <code>noexcept</code>, but the wider range of 
"string operation" functions taking a <code>basic_string_view&lt;charT, traits&gt;</code> parameter are mostly 
<code>noexcept</code> because they had a wide contract. Now with the approach of LWG <a href="lwg-defects.html#2758" title="std::string{}.assign(&quot;ABCDE&quot;, 0, 1) is ambiguous (Status: C++17)">2758</a><sup><a href="https://cplusplus.github.io/LWG/issue2758" title="Latest snapshot">(i)</a></sup>, there are all 
types allowed that are <em>convertible</em> to <code>basic_string_view&lt;charT, traits&gt;</code>, but the conversion 
occurs now in the function body, not outside of it. So, if these conversion <em>would</em> be potentially 
exception-throwing, this would lead to a call to <code>std::terminate</code>, which is a semantic change compared to 
the previous specification. There are several options to handle this situation:
</p>
<ol>
<li><p>Ignore that and let <code>std::terminate</code> come into action. This is a different way of saying that
we impose the requirement of a nothrowing operation.</p></li>
<li><p>Remove <code>noexcept</code> from all the affected functions.</p></li>
<li><p>Make these functions conditionally <code>noexcept</code>.</p></li>
</ol>
<p>
The submitter has a personal preference for option (3), except that this would complicate the wording a bit, 
because unfortunately there exists yet no trait <code>std::is_nothrow_convertible</code> (See LWG <a href="lwg-defects.html#2040" title="Missing type traits related to is_convertible (Status: Resolved)">2040</a><sup><a href="https://cplusplus.github.io/LWG/issue2040" title="Latest snapshot">(i)</a></sup>). 
A seemingly low-hanging fruit would be the attempt to use <code>std::is_nothrow_constructible</code> instead, but this 
trait describes a potentially different initialization context and is therefore inappropriate. Option (1) would 
conserve the existing <code>noexcept</code> guarantee for all non-throwing conversions, but now these functions become 
narrow-contract functions and at least according to the <a href="https://wg21.link/n3279">current <code>noexcept</code> 
guidelines</a> such functions should <em>not</em> be marked as <code>noexcept</code>. But there are exceptions possible 
for that rule, and the initially suggested proposed wording below argues that this exception is reasonable here, 
because the required wording fixes just an unintended side-effects of transforming the functions into functions 
templates, but it doesn't intend to change the actual functionality.
<p/>
Some of the below suggested overload exclusion constraints technically don't require the additional
<code>is_convertible_v&lt;const T&amp;, const charT*&gt; == false</code> requirement, but the submitter of this issue
suggests a more advanced approach that should be applied in a synchronous wording adjustment combined with the 
existing LWG <a href="lwg-defects.html#2758" title="std::string{}.assign(&quot;ABCDE&quot;, 0, 1) is ambiguous (Status: C++17)">2758</a><sup><a href="https://cplusplus.github.io/LWG/issue2758" title="Latest snapshot">(i)</a></sup> wording: It would presumably life easier for implementations (which are allowed
to provide additional member function overloads as conforming extensions), when we would define a mini requirement
set for template parameter type <code>T</code> below:
</p>
<ul>
<li><p><code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code>.</p></li>
<li><p><code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</p></li>
<li><p>The implicit conversion to <code>basic_string_view&lt;charT, traits&gt;</code> shall not throw an exception.</p></li>
</ul>
<p>
But the corresponding slightly revised wording taking advantage of this "concept-like" requirements set will not be
suggested before the upcoming working draft has been published to allow a simpler coordinated adjustment together with
the LWG <a href="lwg-defects.html#2758" title="std::string{}.assign(&quot;ABCDE&quot;, 0, 1) is ambiguous (Status: C++17)">2758</a><sup><a href="https://cplusplus.github.io/LWG/issue2758" title="Latest snapshot">(i)</a></sup> wording.
<p/>
It should also be noted that these changes have impact on deduction behaviour and therefore may require further 
adjustments of the deduction rules.
</p>

<p><i>[2017-07-13, Toronto]</i></p>

<p>
LWG preferred to remove in all functions with added nothrow constraints the <code>noexcept</code> specifier (and the
constraint) and to possibly improve the situation later.
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>
This wording is relative to <a href="https://wg21.link/n4640">N4640</a>.
</p>

<ol>
<li><p>Edit 27.4.3 <a href="https://wg21.link/basic.string">[basic.string]</a>, class template <code>basic_string</code> synopsis, as indicated:</p>
<blockquote>
<pre>
[&hellip;]

<i>// 21.3.2.2, construct/copy/destroy</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
explicit basic_string(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                      const Allocator&amp; a = Allocator());
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
basic_string&amp; operator=(const charT* s);
[&hellip;]

<i>// 21.3.2.6, modifiers</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator+=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; append(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; assign(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; insert(size_type pos, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(size_type pos1, size_type n1, 
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(const_iterator i1, const_iterator i2,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]

<i>// 21.3.2.7, string operations</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                size_type pos = 0) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type rfind(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                size_type pos = npos) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_first_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                        size_type pos = 0) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_last_of (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                        size_type pos = npos) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_first_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = 0) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_last_not_of (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = npos) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
int compare(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const noexcept;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
int compare(size_type pos1, size_type n1, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const;
[&hellip;]
</pre>
</blockquote>
</li>

<li><p>Edit 27.4.3.3 <a href="https://wg21.link/string.cons">[string.cons]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
explicit basic_string(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                      const Allocator&amp; a = Allocator());
</pre>
<blockquote>
<p>
-9- <i>Effects:</i> <del>Same as <code>basic_string(sv.data(), sv.size(), a)</code>.</del><ins>Creates a variable, <code>sv</code>, 
as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> and then behaves the same as 
<code>basic_string(sv.data(), sv.size(), a)</code>.</ins>
<p/>
<ins>-?- <i>Remarks:</i> This constructor shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
<p>
[&hellip;]
</p>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-25- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return assign(sv);
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.op+=] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator+=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-3- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then c</ins><del>C</del>alls <code>append(sv)</code>.
<p/>
-4- <i>Returns:</i> <code>*this</code>.
<p/>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.2 <a href="https://wg21.link/string.append">[string.append]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; append(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-6- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return append(sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.3 <a href="https://wg21.link/string.assign">[string.assign]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; assign(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-8- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return assign(sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.4 <a href="https://wg21.link/string.insert">[string.insert]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; insert(size_type pos, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return insert(pos, sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.6 <a href="https://wg21.link/string.replace">[string.replace]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(size_type pos1, size_type n1,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return replace(pos1, n1, sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
<p>
[&hellip;]
</p>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(const_iterator i1, const_iterator i2,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-21- <i>Requires:</i> <code>[begin(), i1)</code> and <code>[i1, i2)</code> are valid ranges.
<p/>
-22- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then c</ins><del>C</del>alls <code>replace(i1 - begin(), i2 - i1, sv)</code>.
<p/>
-23- <i>Returns:</i> <code>*this</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.8.2 <a href="https://wg21.link/string.find">[string.find]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = 0) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.rfind] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type rfind(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = npos) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.first.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_first_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = 0) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.last.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_last_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = npos) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.first.not.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_first_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = 0) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.last.not.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_last_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                           size_type pos = npos) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.8.4 <a href="https://wg21.link/string.compare">[string.compare]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
int compare(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const noexcept;
</pre>
<blockquote>
<p>
<ins>-?- <i>Requires:</i> The initialization of <code>sv</code>, as specified below, shall not throw an exception.</ins>
<p/>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the effective length <code>rlen</code> of the strings to compare as the smaller of 
<code>size()</code> and <code>sv.size()</code>. The function then compares the two strings by calling <code>traits::compare(data(),
sv.data(), rlen)</code>.
<p/>
-2- <i>Returns:</i> The nonzero result if the result of the comparison is nonzero. Otherwise, returns a value as
indicated in Table 63.
</p>
[&hellip;]
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
int compare(size_type pos1, size_type n1, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const;
</pre>
<blockquote>
<p>
-3- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return basic_string_view&lt;charT, traits&gt;(data(), size()).substr(pos1, n1).compare(sv);
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>
</ol>

</blockquote>

<p><i>[2017-07-14, Toronto, Daniel refines wording]</i></p>

<p>
To balance the loss of information about the removed <code>noexcept</code> specifications, all affected functions
should get a new <i>Throws:</i> element saying that they won't throw unless this is caused by the conversion to
the local <code>basic_string_view</code> object. The existing P/R has been updated to reflect that suggestion.
</p>

<p><i>[2017-07 Toronto Wed Issue Prioritization]</i></p>

<p>Priority ; Marshall to investigate and if OK, will propose Tentatively Ready on reflector.</p>

<p><i>[2018-03-03: STL reported a related issue, LWG <a href="lwg-defects.html#3075" title="basic_string needs deduction guides from basic_string_view (Status: C++20)">3075</a><sup><a href="https://cplusplus.github.io/LWG/issue3075" title="Latest snapshot">(i)</a></sup>.]</i></p>


<p><i>[2018-14: Wednesday night issues processing: both this and <a href="lwg-defects.html#3075" title="basic_string needs deduction guides from basic_string_view (Status: C++20)">3075</a><sup><a href="https://cplusplus.github.io/LWG/issue3075" title="Latest snapshot">(i)</a></sup> to status "Immediate".]</i></p>

<p><i>[2018-3-17 Adopted in Jacksonville]</i></p>



<p id="res-2946"><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="https://wg21.link/n4656">N4656</a>.
</p>

<ol>
<li><p>Edit 27.4.3 <a href="https://wg21.link/basic.string">[basic.string]</a>, class template <code>basic_string</code> synopsis, as indicated:</p>
<blockquote>
<pre>
[&hellip;]

<i>// 21.3.2.2, construct/copy/destroy</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
explicit basic_string(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                      const Allocator&amp; a = Allocator());
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
basic_string&amp; operator=(const charT* s);
[&hellip;]

<i>// 21.3.2.6, modifiers</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator+=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; append(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; assign(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; insert(size_type pos, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(size_type pos1, size_type n1, 
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(const_iterator i1, const_iterator i2,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
[&hellip;]

<i>// 21.3.2.7, string operations</i>
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                size_type pos = 0) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type rfind(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                size_type pos = npos) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_first_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                        size_type pos = 0) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_last_of (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                        size_type pos = npos) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_first_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = 0) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
size_type find_last_not_of (<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = npos) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
int compare(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const <del>noexcept</del>;
[&hellip;]
<ins>template&lt;class T&gt;</ins>
int compare(size_type pos1, size_type n1, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const;
[&hellip;]
</pre>
</blockquote>
</li>

<li><p>Edit 27.4.3.3 <a href="https://wg21.link/string.cons">[string.cons]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
explicit basic_string(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                      const Allocator&amp; a = Allocator());
</pre>
<blockquote>
<p>
-9- <i>Effects:</i> <del>Same as <code>basic_string(sv.data(), sv.size(), a)</code>.</del><ins>Creates a variable, <code>sv</code>, 
as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> and then behaves the same as 
<code>basic_string(sv.data(), sv.size(), a)</code>.</ins>
<p/>
<ins>-?- <i>Remarks:</i> This constructor shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
<p>
[&hellip;]
</p>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-25- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return assign(sv);
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.op+=] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; operator+=(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-3- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then c</ins><del>C</del>alls <code>append(sv)</code>.
<p/>
-4- <i>Returns:</i> <code>*this</code>.
<p/>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.2 <a href="https://wg21.link/string.append">[string.append]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; append(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-6- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return append(sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.3 <a href="https://wg21.link/string.assign">[string.assign]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; assign(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-8- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return assign(sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.4 <a href="https://wg21.link/string.insert">[string.insert]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; insert(size_type pos, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return insert(pos, sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.7.6 <a href="https://wg21.link/string.replace">[string.replace]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(size_type pos1, size_type n1,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return replace(pos1, n1, sv.data(), sv.size());
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
<p>
[&hellip;]
</p>
<pre>
<ins>template&lt;class T&gt;</ins>
basic_string&amp; replace(const_iterator i1, const_iterator i2,
                      <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>);
</pre>
<blockquote>
<p>
-21- <i>Requires:</i> <code>[begin(), i1)</code> and <code>[i1, i2)</code> are valid ranges.
<p/>
-22- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then c</ins><del>C</del>alls <code>replace(i1 - begin(), i2 - i1, sv)</code>.
<p/>
-23- <i>Returns:</i> <code>*this</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.8.2 <a href="https://wg21.link/string.find">[string.find]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = 0) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.rfind] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type rfind(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = npos) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.first.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_first_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = 0) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.last.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_last_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>, size_type pos = npos) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.first.not.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_first_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                            size_type pos = 0) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the lowest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit  [string.find.last.not.of] as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
size_type find_last_not_of(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>,
                           size_type pos = npos) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the highest position <code>xpos</code>, if possible, such that both of the following conditions
hold: [&hellip;]
<p/>
-2- <i>Returns:</i> <code>xpos</code> if the function can determine such a value for <code>xpos</code>. Otherwise, returns <code>npos</code>.
</p>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Edit 27.4.3.8.4 <a href="https://wg21.link/string.compare">[string.compare]</a> as indicated:</p>
<blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
int compare(<del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const <del>noexcept</del>;
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> <ins>Creates a variable, <code>sv</code>, as if by <code>basic_string_view&lt;charT, traits&gt; sv = t;</code> 
and then d</ins><del>D</del>etermines the effective length <code>rlen</code> of the strings to compare as the smaller of 
<code>size()</code> and <code>sv.size()</code>. The function then compares the two strings by calling <code>traits::compare(data(),
sv.data(), rlen)</code>.
<p/>
-2- <i>Returns:</i> The nonzero result if the result of the comparison is nonzero. Otherwise, returns a value as
indicated in Table 63.
</p>
[&hellip;]
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
<p/>
<ins>-?- <i>Throws:</i> Nothing unless the initialization of <code>sv</code> throws an exception.</ins>
</p>
</blockquote>
<pre>
<ins>template&lt;class T&gt;</ins>
int compare(size_type pos1, size_type n1, <del>basic_string_view&lt;charT, traits&gt; sv</del><ins>const T&amp; t</ins>) const;
</pre>
<blockquote>
<p>
-3- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
<ins>{</ins>
  <ins>basic_string_view&lt;charT, traits&gt; sv = t;</ins>
  return basic_string_view&lt;charT, traits&gt;(data(), size()).substr(pos1, n1).compare(sv);
<ins>}</ins>
</pre>
</blockquote>
<p>
<ins>-?- <i>Remarks:</i> This function shall not participate in overload resolution unless 
<code>is_convertible_v&lt;const T&amp;, basic_string_view&lt;charT, traits&gt;&gt;</code> is <code>true</code> and 
<code>is_convertible_v&lt;const T&amp;, const charT*&gt;</code> is <code>false</code>.</ins>
</p>
</blockquote>
</blockquote>
</li>
</ol>






</body>
</html>
