mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
Add equality operator for range
The operator== is needed when actually using a hash table - the hash function is not enough. Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
This commit is contained in:
@@ -24,6 +24,9 @@ public:
|
||||
const T& value() const & { return _value; }
|
||||
T&& value() && { return std::move(_value); }
|
||||
bool is_inclusive() const { return _inclusive; }
|
||||
bool operator==(const bound& other) const {
|
||||
return (_value == other._value) && (_inclusive == other._inclusive);
|
||||
}
|
||||
};
|
||||
private:
|
||||
optional<bound> _start;
|
||||
@@ -243,6 +246,10 @@ public:
|
||||
return range(std::move(s), std::move(e), singular);
|
||||
}
|
||||
|
||||
bool operator==(const range& other) const {
|
||||
return (_start == other._start) && (_end == other._end) && (_singular == other._singular);
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
friend std::ostream& operator<<(std::ostream& out, const range<U>& r);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user