[llvm] [STLExtras] Add out-of-line definition of friend operator== for C++20 (PR #72348)
Ilya Biryukov via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 02:12:00 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
----------------
ilya-biryukov wrote:
We do not need to declare this as a friend, the implementation only uses the public methods.
Could we remove the friend declarations completely and only keep the out-of-line functions?
https://github.com/llvm/llvm-project/pull/72348
More information about the llvm-commits
mailing list