From c662ee698c6366e1b53856eb1a2c903c301a426f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 28 Feb 2022 23:00:04 +0800 Subject: [PATCH] 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 --- .../seastore/omap_manager/btree/string_kv_node_layout.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 9948a4292fd98..1bd95415a48a1 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; } -- 2.39.5