Define operator!= in terms of operator== (#1659)

This commit is contained in:
Rangi
2025-02-15 11:34:06 +01:00
committed by GitHub
parent b2e865ee2a
commit 62309d5c87
4 changed files with 9 additions and 9 deletions

View File

@@ -86,8 +86,9 @@ private:
public:
Iter() = default;
bool operator==(Iter const &other) const { return _iter == other._iter; }
bool operator!=(Iter const &other) const { return !(*this == other); }
bool operator==(Iter const &rhs) const { return _iter == rhs._iter; }
bool operator!=(Iter const &rhs) const { return !operator==(rhs); }
Iter &operator++() {
++_iter;
skipEmpty();
@@ -98,6 +99,7 @@ private:
++(*this);
return it;
}
reference operator*() const {
assume((*_iter).has_value());
return **_iter;