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

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 9 12:28:19 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;
+  };
----------------
cjdb wrote:

Understood, I didn't realise that references implicitly delete defaulted comparison operators (it makes sense to me that they do). Could you please provide a comment about why this is required (same as below)?

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


More information about the libcxx-commits mailing list