Skip to content

[STLExtras] Remove incorrect hack to make indexed_accessor_range operator== compatible with C++20 #72220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -1291,15 +1291,11 @@ 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);
template <typename OtherT> bool operator==(const OtherT &rhs) const {
return std::equal(begin(), end(), rhs.begin(), rhs.end());
}
template <typename OtherT> bool operator!=(const OtherT &rhs) const {
return !(*this == rhs);
}

/// Return the size of this range.
Expand Down