[libcxx-commits] [libcxx] [libc++] Improve code gen for string's operator== (PR #100926)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 30 09:04:37 PDT 2024


================
@@ -2246,6 +2246,10 @@ private:
   friend constexpr basic_string operator+ <>(const basic_string&, type_identity_t<__self_view>);
   friend constexpr basic_string operator+ <>(type_identity_t<__self_view>, const basic_string&);
 #endif
+
+  template <class _CharT2, class _Traits2, class _Allocator2>
+  friend inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
+  operator==(const basic_string<_CharT2, _Traits2, _Allocator2>&, const _CharT2*) _NOEXCEPT;
----------------
philnik777 wrote:

Because we wouldn't be conforming then. This `operator==` isn't defined as a hidden friend in the standard.

https://github.com/llvm/llvm-project/pull/100926


More information about the libcxx-commits mailing list