[flang] [clang] [libunwind] [compiler-rt] [libc] [libcxx] [clang-tools-extra] [lldb] [llvm] [libc++] Implement ranges::iota (PR #68494)

James E T Smith via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 6 10:41:18 PST 2024


================
@@ -1149,9 +1171,11 @@ struct Proxy {
   // Calling swap(Proxy<T>{}, Proxy<T>{}) would fail (pass prvalues)
 
   // Compare operators are defined for the convenience of the tests
-  friend constexpr bool operator==(const Proxy&, const Proxy&)
-    requires (std::equality_comparable<T> && !std::is_reference_v<T>)
-  = default;
+  friend constexpr bool operator==(const Proxy& lhs, const Proxy& rhs)
+    requires(std::equality_comparable<T> && !std::is_reference_v<T>)
+  {
+    return lhs.data == rhs.data;
+  };
----------------
jamesETsmith wrote:

For this operator and the spaceship operator below, the default functions do not satisfy the requirements on the functions (e.g. `std::equality_comparable`) (see the previous discussion about it [here](https://github.com/llvm/llvm-project/pull/68494#issuecomment-1783604000)). 

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


More information about the cfe-commits mailing list