[ 2016-10 Telecon ]
Ville's wording has been implemented in libstdc++ and libc++. Move this to Tentatively Ready and 2757 to Tentatively Resolved
Previous resolution [SUPERSEDED]:
This wording is relative to N4606.
In [basic.string] modify the synopsis for basic_string as follows:
namespace std { template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>> class basic_string { public: […] template<class T> basic_string& append(basic_string_view<charT, traits> svconst T& t, size_type pos, size_type n = npos); […] template<class T> basic_string& assign(basic_string_view<charT, traits> svconst T& t, size_type pos, size_type n = npos); […] template<class T> basic_string& insert(size_type pos1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n = npos); […] template<class T> basic_string& replace(size_type pos1, size_type n1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n2 = npos); […] template<class T> int compare(size_type pos1, size_type n1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n2 = npos) const; […] }; }In [string.append], modify basic_string_view overload as follows:
template<class T> basic_string& append(basic_string_view<charT, traits> svconst T& t, size_type pos, size_type n = npos);-7- Throws: out_of_range if pos > sv.size().
-8- Effects: Creates a variable, sv, as if by basic_string_view<charT, traits> sv = t. Determines the effective length rlen of the string to append as the smaller of n and sv.size() - pos and calls append(sv.data() + pos, rlen).
-?- Remarks: This function shall not participate in overload resolution unless is_convertible_v<const T&, basic_string_view<charT, traits>> is true.
-9- Returns: *this.
In [string.assign], modify basic_string_view overload as follows:
template<class T> basic_string& assign(basic_string_view<charT, traits> svconst T& t, size_type pos, size_type n = npos);-9- Throws: out_of_range if pos > sv.size().
-10- Effects: Creates a variable, sv, as if by basic_string_view<charT, traits> sv = t. Determines the effective length rlen of the string to assign as the smaller of n and sv.size() - pos and calls assign(sv.data() + pos, rlen).
-?- Remarks: This function shall not participate in overload resolution unless is_convertible_v<const T&, basic_string_view<charT, traits>> is true.
-11- Returns: *this.
In [string.insert], modify basic_string_view overload as follows:
template<class T> basic_string& insert(size_type pos1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n = npos);-6- Throws: out_of_range if pos1 > size() or pos2 > sv.size().
-7- Effects: Creates a variable, sv, as if by basic_string_view<charT, traits> sv = t. Determines the effective length rlen of the string to assign as the smaller of n and sv.size() - pos2 and calls insert(pos1, sv.data() + pos2, rlen).
-?- Remarks: This function shall not participate in overload resolution unless is_convertible_v<const T&, basic_string_view<charT, traits>> is true.
-8- Returns: *this.
In [string.replace], modify basic_string_view overload as follows:
template<class T> basic_string& replace(size_type pos1, size_type n1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n2 = npos);-6- Throws: out_of_range if pos1 > size() or pos2 > sv.size().
-7- Effects: Creates a variable, sv, as if by basic_string_view<charT, traits> sv = t. Determines the effective length rlen of the string to be inserted as the smaller of n2 and sv.size() - pos2 and calls replace(pos1, n1, sv.data() + pos2, rlen).
-?- Remarks: This function shall not participate in overload resolution unless is_convertible_v<const T&, basic_string_view<charT, traits>> is true.
-8- Returns: *this.
In [string.compare], modify basic_string_view overload as follows:
template<class T> int compare(size_type pos1, size_type n1,basic_string_view<charT, traits> svconst T& t, size_type pos2, size_type n2 = npos) const;-4- Effects: Equivalent to:
{ basic_string_view<charT, traits> sv = t; return basic_string_view<charT, traits>(this.data(), pos1, n1).compare(sv, pos2, n2); }-?- Remarks: This function shall not participate in overload resolution unless is_convertible_v<const T&, basic_string_view<charT, traits>> is true.