prevector: simplify operator==

This commit is contained in:
Daniel Pfeifer 2025-11-03 15:10:05 +01:00
parent 01dcb2fcc5
commit 2678abe902
No known key found for this signature in database
GPG Key ID: 04AA0741B1724E04

View File

@ -426,21 +426,8 @@ public:
}
}
bool operator==(const prevector<N, T, Size, Diff>& other) const {
if (other.size() != size()) {
return false;
}
const_iterator b1 = begin();
const_iterator b2 = other.begin();
const_iterator e1 = end();
while (b1 != e1) {
if ((*b1) != (*b2)) {
return false;
}
++b1;
++b2;
}
return true;
constexpr bool operator==(const prevector& other) const {
return std::ranges::equal(*this, other);
}
bool operator<(const prevector<N, T, Size, Diff>& other) const {