[libcxx-commits] [libcxx] [libc++] P3379R1: Constrain `std::expected` equality operators (PR #117664)

Xiaoyang Liu via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 27 22:20:13 PST 2024


================
@@ -1139,7 +1140,11 @@ class expected : private __expected_base<_Tp, _Err> {
 
   // [expected.object.eq], equality operators
   template <class _T2, class _E2>
-    requires(!is_void_v<_T2>)
+    requires(!is_void_v<_T2> &&
+             requires(const _Tp& __tp, const _T2& __t2, const _Err& __err, const _E2& __e2) {
+               { __tp == __t2 } -> convertible_to<bool>;
----------------
xiaoyang-sde wrote:

Thank you for writing this! I'll take a look.

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


More information about the libcxx-commits mailing list