diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -875,7 +875,7 @@ } #endif // _LIBCPP_CXX03_LANG - template ::value, nullptr_t> > + template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) { _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr"); @@ -883,7 +883,7 @@ std::__debug_db_insert_c(this); } - template ::value, nullptr_t> > + template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a); #if _LIBCPP_STD_VER >= 23 @@ -941,7 +941,7 @@ } #endif - template ::value, nullptr_t> > + template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a); _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -958,31 +958,31 @@ } template ::value && - !__is_same_uncvref<_Tp, basic_string>::value> > + __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && + !__is_same_uncvref<_Tp, basic_string>::value, int> = 0> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type()); template ::value && - !__is_same_uncvref<_Tp, basic_string>::value> > + __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && + !__is_same_uncvref<_Tp, basic_string>::value, int> = 0> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string( const _Tp& __t); template ::value && - !__is_same_uncvref<_Tp, basic_string>::value> > + __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && + !__is_same_uncvref<_Tp, basic_string>::value, int> = 0> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string( const _Tp& __t, const allocator_type& __a); - template ::value> > + template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last) : __r_(__default_init_tag(), __default_init_tag()) { __init(__first, __last); std::__debug_db_insert_c(this); } - template ::value> > + template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : __r_(__default_init_tag(), __a) { @@ -1011,8 +1011,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const basic_string& __str); - template ::value && - !__is_same_uncvref<_Tp, basic_string>::value> > + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, int> = 0> _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const _Tp& __t) { __self_view __sv = __t; return assign(__sv); @@ -1132,14 +1132,11 @@ return append(__str); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string >::value, - basic_string& - > + template ::value && + !__is_same_uncvref<_Tp, basic_string >::value, + int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const _Tp& __t) { __self_view __sv = __t; return append(__sv); } @@ -1162,25 +1159,27 @@ return append(__str.data(), __str.size()); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string>::value, - basic_string& - > - append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); } + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + append(const _Tp& __t) { + __self_view __sv = __t; + return append(__sv.data(), __sv.size()); + } + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos); - template + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string>::value, - basic_string& - > - append(const _Tp& __t, size_type __pos, size_type __n=npos); + + basic_string& + append(const _Tp& __t, size_type __pos, size_type __n = npos); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c); @@ -1188,27 +1187,16 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append_default_init(size_type __n); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS - __enable_if_t - < - __is_exactly_cpp17_input_iterator<_InputIterator>::value, - basic_string& - > - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(_InputIterator __first, _InputIterator __last) { - const basic_string __temp(__first, __last, __alloc()); - append(__temp.data(), __temp.size()); - return *this; + const basic_string __temp(__first, __last, __alloc()); + append(__temp.data(), __temp.size()); + return *this; } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS - __enable_if_t - < - __is_cpp17_forward_iterator<_ForwardIterator>::value, - basic_string& - > - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(_ForwardIterator __first, _ForwardIterator __last); #ifndef _LIBCPP_CXX03_LANG @@ -1239,14 +1227,13 @@ return *(data() + size() - 1); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - basic_string& - > - assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); } + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + assign(const _Tp& __t) { + __self_view __sv = __t; + return assign(__sv.data(), __sv.size()); + } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str) { return *this = __str; } #ifndef _LIBCPP_CXX03_LANG @@ -1256,34 +1243,25 @@ {*this = std::move(__str); return *this;} #endif _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string>::value, - basic_string& - > - assign(const _Tp & __t, size_type __pos, size_type __n=npos); + + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + assign(const _Tp& __t, size_type __pos, size_type __n = npos); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s, size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(const value_type* __s); _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(size_type __n, value_type __c); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_exactly_cpp17_input_iterator<_InputIterator>::value, - basic_string& - > - assign(_InputIterator __first, _InputIterator __last); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_cpp17_forward_iterator<_ForwardIterator>::value, - basic_string& - > - assign(_ForwardIterator __first, _ForwardIterator __last); + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + assign(_InputIterator __first, _InputIterator __last); + + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + assign(_ForwardIterator __first, _ForwardIterator __last); + #ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign(initializer_list __il) {return assign(__il.begin(), __il.size());} @@ -1294,30 +1272,26 @@ return insert(__pos1, __str.data(), __str.size()); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - basic_string& - > - insert(size_type __pos1, const _Tp& __t) - { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); } - - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value, - basic_string& - > - insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos); - _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos); - _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n); - _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s); - _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c); - _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c); + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + insert(size_type __pos1, const _Tp& __t) { + __self_view __sv = __t; + return insert(__pos1, __sv.data(), __sv.size()); + } + + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n = npos); + + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c); + _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, size_type __n, value_type __c) { @@ -1328,22 +1302,14 @@ return begin() + __p; } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_exactly_cpp17_input_iterator<_InputIterator>::value, - iterator - > - insert(const_iterator __pos, _InputIterator __first, _InputIterator __last); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_cpp17_forward_iterator<_ForwardIterator>::value, - iterator - > - insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last); + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator + insert(const_iterator __pos, _InputIterator __first, _InputIterator __last); + + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator + insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last); + #ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, initializer_list __il) @@ -1361,28 +1327,27 @@ return replace(__pos1, __n1, __str.data(), __str.size()); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - basic_string& - > - replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); } - _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos); - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value, - basic_string& - > - replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos); - _LIBCPP_CONSTEXPR_SINCE_CXX20 - basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2); - _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s); - _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c); + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(size_type __pos1, size_type __n1, const _Tp& __t) { + __self_view __sv = __t; + return replace(__pos1, __n1, __sv.data(), __sv.size()); + } + + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos); + + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos); + + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s); + _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c); _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str) { @@ -1390,14 +1355,12 @@ static_cast(__i1 - begin()), static_cast(__i2 - __i1), __str.data(), __str.size()); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - basic_string& - > - replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); } + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { + __self_view __sv = __t; + return replace(__i1 - begin(), __i2 - __i1, __sv); + } _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n) { @@ -1414,14 +1377,10 @@ return replace(static_cast(__i1 - begin()), static_cast(__i2 - __i1), __n, __c); } - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_cpp17_input_iterator<_InputIterator>::value, - basic_string& - > - replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2); + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& + replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2); + #ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list __il) @@ -1471,16 +1430,11 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_CONSTEXPR_SINCE_CXX20 - size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT; + + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT; @@ -1488,14 +1442,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1505,14 +1455,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1523,14 +1469,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1541,14 +1483,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + find_first_not_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1559,14 +1497,10 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - size_type - > - find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type + find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1577,23 +1511,13 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const basic_string& __str) const _NOEXCEPT; - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - int - > - compare(const _Tp &__t) const _NOEXCEPT; - - template - _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - int - > - compare(size_type __pos1, size_type __n1, const _Tp& __t) const; + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int + compare(const _Tp& __t) const _NOEXCEPT; + + template ::value, int> = 0> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 int + compare(size_type __pos1, size_type __n1, const _Tp& __t) const; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(size_type __pos1, size_type __n1, const basic_string& __str) const; @@ -1601,14 +1525,13 @@ int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos) const; - template - inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value, - int - > - compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const; + template ::value && + !__is_same_uncvref<_Tp, basic_string>::value, + int> = 0> + inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int + compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2 = npos) const; + _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* __s) const _NOEXCEPT; _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(size_type __pos1, size_type __n1, const value_type* __s) const; _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -1839,21 +1762,11 @@ // to only inline the fast path code directly in the ctor. _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init_copy_ctor_external(const value_type* __s, size_type __sz); - template - inline _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_exactly_cpp17_input_iterator<_InputIterator>::value - > - __init(_InputIterator __first, _InputIterator __last); + template ::value, int> = 0> + inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_InputIterator __first, _InputIterator __last); - template - inline _LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __is_cpp17_forward_iterator<_ForwardIterator>::value - > - __init(_ForwardIterator __first, _ForwardIterator __last); + template ::value, int> = 0> + inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init(_ForwardIterator __first, _ForwardIterator __last); _LIBCPP_CONSTEXPR_SINCE_CXX20 void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz, @@ -2129,7 +2042,7 @@ } template -template +template <__enable_if_t<__is_allocator<_Allocator>::value, int> > _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a) : __r_(__default_init_tag(), __a) @@ -2220,7 +2133,7 @@ } template -template +template <__enable_if_t<__is_allocator<_Allocator>::value, int> > _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a) : __r_(__default_init_tag(), __a) @@ -2244,12 +2157,13 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -basic_string<_CharT, _Traits, _Allocator>::basic_string( - const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a) - : __r_(__default_init_tag(), __a) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>::basic_string( + const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a) + : __r_(__default_init_tag(), __a) { __self_view __sv0 = __t; __self_view __sv = __sv0.substr(__pos, __n); __init(__sv.data(), __sv.size()); @@ -2257,35 +2171,34 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t) - : __r_(__default_init_tag(), __default_init_tag()) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp& __t) + : __r_(__default_init_tag(), __default_init_tag()) { __self_view __sv = __t; __init(__sv.data(), __sv.size()); std::__debug_db_insert_c(this); } template -template +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > _LIBCPP_CONSTEXPR_SINCE_CXX20 -basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _Allocator& __a) - : __r_(__default_init_tag(), __a) -{ +basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp& __t, const _Allocator& __a) + : __r_(__default_init_tag(), __a) { __self_view __sv = __t; __init(__sv.data(), __sv.size()); std::__debug_db_insert_c(this); } template -template +template ::value, int> > _LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_exactly_cpp17_input_iterator<_InputIterator>::value -> -basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last) +void basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last) { __default_init(); #ifndef _LIBCPP_HAS_NO_EXCEPTIONS @@ -2306,12 +2219,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_cpp17_forward_iterator<_ForwardIterator>::value -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last) { if (__libcpp_is_constant_evaluated()) @@ -2584,13 +2493,8 @@ #endif template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_exactly_cpp17_input_iterator<_InputIterator>::value, - basic_string<_CharT, _Traits, _Allocator>& -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last) { const basic_string __temp(__first, __last, __alloc()); @@ -2599,13 +2503,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_cpp17_forward_iterator<_ForwardIterator>::value, - basic_string<_CharT, _Traits, _Allocator>& -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last) { size_type __cap = capacity(); @@ -2647,16 +2546,12 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, - basic_string<_CharT, _Traits, _Allocator>& -> -basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& +basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp& __t, size_type __pos, size_type __n) { __self_view __sv = __t; size_type __sz = __sv.size(); if (__pos > __sz) @@ -2664,7 +2559,6 @@ return assign(__sv.data() + __pos, std::min(__n, __sz - __pos)); } - template _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& @@ -2786,13 +2680,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_cpp17_forward_iterator<_ForwardIterator>::value, - basic_string<_CharT, _Traits, _Allocator>& -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::append( _ForwardIterator __first, _ForwardIterator __last) { @@ -2833,15 +2722,12 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 - __enable_if_t - < - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, - basic_string<_CharT, _Traits, _Allocator>& - > -basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& +basic_string<_CharT, _Traits, _Allocator>::append(const _Tp& __t, size_type __pos, size_type __n) { __self_view __sv = __t; size_type __sz = __sv.size(); if (__pos > __sz) @@ -2933,13 +2819,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_exactly_cpp17_input_iterator<_InputIterator>::value, - typename basic_string<_CharT, _Traits, _Allocator>::iterator -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this, @@ -2950,13 +2831,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_cpp17_forward_iterator<_ForwardIterator>::value, - typename basic_string<_CharT, _Traits, _Allocator>::iterator -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this, @@ -2991,16 +2867,12 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, - basic_string<_CharT, _Traits, _Allocator>& -> -basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t, - size_type __pos2, size_type __n) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& +basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n) { __self_view __sv = __t; size_type __str_sz = __sv.size(); if (__pos2 > __str_sz) @@ -3135,13 +3007,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __is_cpp17_input_iterator<_InputIterator>::value, - basic_string<_CharT, _Traits, _Allocator>& -> +template::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2) { @@ -3162,16 +3029,13 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, - basic_string<_CharT, _Traits, _Allocator>& -> -basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t, - size_type __pos2, size_type __n2) -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>& +basic_string<_CharT, _Traits, _Allocator>::replace( + size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) { __self_view __sv = __t; size_type __str_sz = __sv.size(); if (__pos2 > __str_sz) @@ -3495,13 +3359,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t, size_type __pos) const _NOEXCEPT { @@ -3556,13 +3415,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t, size_type __pos) const _NOEXCEPT { @@ -3617,13 +3471,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t, size_type __pos) const _NOEXCEPT { @@ -3677,13 +3526,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t, size_type __pos) const _NOEXCEPT { @@ -3737,13 +3581,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t, size_type __pos) const _NOEXCEPT { @@ -3798,13 +3637,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - typename basic_string<_CharT, _Traits, _Allocator>::size_type -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t, size_type __pos) const _NOEXCEPT { @@ -3837,13 +3671,8 @@ // compare template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - int -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 int basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const _NOEXCEPT { __self_view __sv = __t; @@ -3893,13 +3722,8 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, - int -> +template ::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 int basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, const _Tp& __t) const @@ -3919,20 +3743,12 @@ } template -template -_LIBCPP_CONSTEXPR_SINCE_CXX20 -__enable_if_t -< - __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value - && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, - int -> -basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, - size_type __n1, - const _Tp& __t, - size_type __pos2, - size_type __n2) const -{ +template ::value && + !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value, + int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 int basic_string<_CharT, _Traits, _Allocator>::compare( + size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2) const { __self_view __sv = __t; return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2)); }