From: Casey Bodley Date: Fri, 11 Feb 2022 23:52:35 +0000 (-0500) Subject: cpp-btree: Add alternative overload for btree:operator== X-Git-Tag: v18.0.0~1237^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b779a1762e2b64f0da05cb8004db70da706cb4cf;p=ceph.git cpp-btree: Add alternative overload for btree:operator== Silence Clang's C++20 -Wambiguous-reversed-operator. cbodley took this from https://github.com/Kronuz/cpp-btree/pull/4 Signed-off-by: Casey Bodley --- diff --git a/src/include/cpp-btree/btree.h b/src/include/cpp-btree/btree.h index f00abc8682f..2eddc2abe80 100644 --- a/src/include/cpp-btree/btree.h +++ b/src/include/cpp-btree/btree.h @@ -812,6 +812,12 @@ struct btree_iterator { bool operator!=(const const_iterator &x) const { return node != x.node || position != x.position; } + bool operator==(const iterator& x) const { + return node == x.node && position == x.position; + } + bool operator!=(const iterator& x) const { + return node != x.node || position != x.position; + } // Accessors for the key/value the iterator is pointing at. reference operator*() const {