From cc64e46425ffb85347582f5586e2500f598df6ca Mon Sep 17 00:00:00 2001 From: Nadav Har'El Date: Mon, 27 Jul 2015 15:41:10 +0300 Subject: [PATCH] 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 --- query-request.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/query-request.hh b/query-request.hh index a5883600ec..2614d9f0a1 100644 --- a/query-request.hh +++ b/query-request.hh @@ -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 _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 friend std::ostream& operator<<(std::ostream& out, const range& r); };