From: Kefu Chai Date: Mon, 28 Feb 2022 15:00:04 +0000 (+0800) Subject: crimson/os: define iterator without std::iterator<> X-Git-Tag: v18.0.0~1321^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c662ee698c6366e1b53856eb1a2c903c301a426f;p=ceph.git crimson/os: define iterator without std::iterator<> std::iterator<> is deprecated in C++17, so let's just define the required traits directly. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h index 9948a4292fd..1bd95415a48 100644 --- a/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h +++ b/src/crimson/os/seastore/omap_manager/btree/string_kv_node_layout.h @@ -294,7 +294,7 @@ class StringKVInnerNodeLayout { friend class delta_inner_t; public: template - class iter_t : public std::iterator { + class iter_t { friend class StringKVInnerNodeLayout; template @@ -312,6 +312,12 @@ public: uint16_t index) : node(parent), index(index) {} public: + using iterator_category = std::input_iterator_tag; + using value_type = StringKVInnerNodeLayout; + using difference_type = std::ptrdiff_t; + using pointer = StringKVInnerNodeLayout*; + using reference = iter_t&; + iter_t(const iter_t &) = default; iter_t(iter_t &&) = default; iter_t &operator=(const iter_t &) = default; @@ -322,7 +328,6 @@ public: return iter_t(node, index); } - using reference = iter_t&; iter_t &operator*() { return *this; } iter_t *operator->() { return this; }