Skip to content

Commit b100ca6

Browse files
committed
Revert "[STLExtras] Undo C++20 hack"
This reverts commit e558be5.
1 parent 9022f40 commit b100ca6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

llvm/include/llvm/ADT/STLExtras.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,11 +1291,15 @@ class indexed_accessor_range_base {
12911291
}
12921292

12931293
/// Compare this range with another.
1294-
template <typename OtherT> bool operator==(const OtherT &rhs) const {
1295-
return std::equal(begin(), end(), rhs.begin(), rhs.end());
1296-
}
1297-
template <typename OtherT> bool operator!=(const OtherT &rhs) const {
1298-
return !(*this == rhs);
1294+
template <typename OtherT>
1295+
friend bool operator==(const indexed_accessor_range_base &lhs,
1296+
const OtherT &rhs) {
1297+
return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
1298+
}
1299+
template <typename OtherT>
1300+
friend bool operator!=(const indexed_accessor_range_base &lhs,
1301+
const OtherT &rhs) {
1302+
return !(lhs == rhs);
12991303
}
13001304

13011305
/// Return the size of this range.

0 commit comments

Comments
 (0)