[llvm] [STLExtras] Add out-of-line definition of friend operator== for C++20 (PR #72348)

Utkarsh Saxena via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 04:59:03 PST 2023


================
@@ -1291,16 +1291,19 @@ class indexed_accessor_range_base {
   }
 
   /// Compare this range with another.
-  template <typename OtherT>
-  friend bool operator==(const indexed_accessor_range_base &lhs,
-                         const OtherT &rhs) {
-    return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
-  }
-  template <typename OtherT>
-  friend bool operator!=(const indexed_accessor_range_base &lhs,
-                         const OtherT &rhs) {
-    return !(lhs == rhs);
-  }
+  // FIXME: Make me a member function instead of friend when it works in C++20.
+  template <typename OtherT, typename DerivedT2, typename BaseT2, typename T2,
+            typename PointerT2, typename ReferenceT2>
+  friend bool
----------------
usx95 wrote:

Makes sense. Done.

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


More information about the llvm-commits mailing list