]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cpp-btree: Add alternative overload for btree:operator==
authorCasey Bodley <cbodley@redhat.com>
Fri, 11 Feb 2022 23:52:35 +0000 (18:52 -0500)
committerKefu Chai <tchaikov@gmail.com>
Thu, 17 Mar 2022 14:00:35 +0000 (22:00 +0800)
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 <cbodley@redhat.com>
src/include/cpp-btree/btree.h

index f00abc8682f2705b44eb445a8ffa684f69e076c6..2eddc2abe80cf74d1c71fa0e7f1d11335ac43546 100644 (file)
@@ -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 {