[libcxx-commits] [libcxx] [llvm] [libc++] Implement P3379R0 Constrain `std::expected` equality operators (PR #135759)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 29 05:02:38 PDT 2025


================
@@ -1860,7 +1887,14 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
   }
 
   template <class _E2>
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected& __x, const unexpected<_E2>& __y) {
+  _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected& __x, const unexpected<_E2>& __y)
+#  if _LIBCPP_STD_VER >= 26
+
+    requires requires {
+      { __x.error() == __y.error() } -> __core_convertible_to<bool>;
+    }
----------------
yronglin wrote:

Removed.

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


More information about the libcxx-commits mailing list