@@ -1881,11 +1881,6 @@ public:
1881
1881
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __clear_and_shrink () _NOEXCEPT;
1882
1882
1883
1883
private:
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
-
1889
1884
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __shrink_or_extend (size_type __target_capacity);
1890
1885
1891
1886
_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>
3842
3837
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
3843
3838
operator ==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
3844
3839
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
3848
3840
size_t __lhs_sz = __lhs.size ();
3849
3841
return __lhs_sz == __rhs.size () && _Traits::compare (__lhs.data (), __rhs.data (), __lhs_sz) == 0 ;
3850
- # endif
3851
3842
}
3852
3843
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
-
3876
3844
template <class _CharT , class _Traits , class _Allocator >
3877
3845
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
3878
3846
operator ==(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*
3890
3858
return __lhs.compare (0 , _String::npos, __rhs, __rhs_len) == 0 ;
3891
3859
}
3892
3860
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
3894
3870
3895
3871
template <class _CharT , class _Traits , class _Allocator >
3896
3872
_LIBCPP_HIDE_FROM_ABI constexpr auto operator <=>(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
0 commit comments