@@ -1881,11 +1881,6 @@ public:
18811881 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __clear_and_shrink () _NOEXCEPT;
18821882
18831883private:
1884- template <class _Alloc >
1885- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool friend
1886- operator ==(const basic_string<char , char_traits<char >, _Alloc>& __lhs,
1887- const basic_string<char , char_traits<char >, _Alloc>& __rhs) _NOEXCEPT;
1888-
18891884 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __shrink_or_extend (size_type __target_capacity);
18901885
18911886 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS bool
@@ -3842,37 +3837,10 @@ template <class _CharT, class _Traits, class _Allocator>
38423837inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
38433838operator ==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
38443839 const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
3845- # if _LIBCPP_STD_VER >= 20
3846- return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
3847- # else
38483840 size_t __lhs_sz = __lhs.size ();
38493841 return __lhs_sz == __rhs.size () && _Traits::compare (__lhs.data (), __rhs.data (), __lhs_sz) == 0 ;
3850- # endif
38513842}
38523843
3853- template <class _Allocator >
3854- inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
3855- operator ==(const basic_string<char , char_traits<char >, _Allocator>& __lhs,
3856- const basic_string<char , char_traits<char >, _Allocator>& __rhs) _NOEXCEPT {
3857- size_t __sz = __lhs.size ();
3858- if (__sz != __rhs.size ())
3859- return false ;
3860- return char_traits<char >::compare (__lhs.data (), __rhs.data (), __sz) == 0 ;
3861- }
3862-
3863- # if _LIBCPP_STD_VER <= 17
3864- template <class _CharT , class _Traits , class _Allocator >
3865- inline _LIBCPP_HIDE_FROM_ABI bool
3866- operator ==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
3867- typedef basic_string<_CharT, _Traits, _Allocator> _String;
3868- _LIBCPP_ASSERT_NON_NULL (__lhs != nullptr , " operator==(char*, basic_string): received nullptr" );
3869- size_t __lhs_len = _Traits::length (__lhs);
3870- if (__lhs_len != __rhs.size ())
3871- return false ;
3872- return __rhs.compare (0 , _String::npos, __lhs, __lhs_len) == 0 ;
3873- }
3874- # endif // _LIBCPP_STD_VER <= 17
3875-
38763844template <class _CharT , class _Traits , class _Allocator >
38773845inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
38783846operator ==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) _NOEXCEPT {
@@ -3890,7 +3858,15 @@ operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT*
38903858 return __lhs.compare (0 , _String::npos, __rhs, __rhs_len) == 0 ;
38913859}
38923860
3893- # if _LIBCPP_STD_VER >= 20
3861+ #if _LIBCPP_STD_VER <= 17
3862+ template <class _CharT , class _Traits , class _Allocator >
3863+ inline _LIBCPP_HIDE_FROM_ABI bool
3864+ operator ==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT {
3865+ return __rhs == __lhs;
3866+ }
3867+ #endif // _LIBCPP_STD_VER <= 17
3868+
3869+ #if _LIBCPP_STD_VER >= 20
38943870
38953871template <class _CharT , class _Traits , class _Allocator >
38963872_LIBCPP_HIDE_FROM_ABI constexpr auto operator <=>(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
0 commit comments