diff --git a/nano/node/lmdb/lmdb_iterator.hpp b/nano/node/lmdb/lmdb_iterator.hpp index 93e2b9396..e1e6e47b2 100644 --- a/nano/node/lmdb/lmdb_iterator.hpp +++ b/nano/node/lmdb/lmdb_iterator.hpp @@ -96,6 +96,16 @@ public: return ¤t; } + bool operator== (nano::mdb_iterator const & base_a) const + { + auto const other_a (boost::polymorphic_downcast const *> (&base_a)); + auto result (current.first.data () == other_a->current.first.data ()); + debug_assert (!result || (current.first.size () == other_a->current.first.size ())); + debug_assert (!result || (current.second.data () == other_a->current.second.data ())); + debug_assert (!result || (current.second.size () == other_a->current.second.size ())); + return result; + } + bool operator== (nano::store_iterator_impl const & base_a) const override { auto const other_a (boost::polymorphic_downcast const *> (&base_a)); @@ -210,11 +220,21 @@ public: return least_iterator ().operator-> (); } + bool operator== (nano::mdb_merge_iterator const & other) const + { + return *impl1 == *other.impl1 && *impl2 == *other.impl2; + } + + bool operator!= (nano::mdb_merge_iterator const & base_a) const + { + return !(*this == base_a); + } + bool operator== (nano::store_iterator_impl const & base_a) const override { debug_assert ((dynamic_cast const *> (&base_a) != nullptr) && "Incompatible iterator comparison"); auto & other (static_cast const &> (base_a)); - return *impl1 == *other.impl1 && *impl2 == *other.impl2; + return *this == other; } bool is_end_sentinal () const override