summarylogtreecommitdiffstats
path: root/ceph-17.2.5-fix-iterator-depreciations.patch
blob: db57ed69684336b95166fb5f3ea5896926e4466c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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..505f9826919 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,13 @@ class StringKVInnerNodeLayout {
   friend class delta_inner_t;
 public:
   template <bool is_const>
-  class iter_t : public std::iterator<std::input_iterator_tag, StringKVInnerNodeLayout> {
+  class iter_t {
+    using iterator_category = std::input_iterator_tag;
+    using value_type = StringKVInnerNodeLayout;
+    using difference_type = std::ptrdiff_t;
+    using pointer = StringKVInnerNodeLayout*;
+    using reference = StringKVInnerNodeLayout&;
+
     friend class StringKVInnerNodeLayout;
 
     template <typename iterator, typename const_iterator>
diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp
index b40d7bf9a57..683a87a28f4 100644
--- a/src/include/rados/librados.hpp
+++ b/src/include/rados/librados.hpp
@@ -104,8 +104,14 @@ inline namespace v14_2_0 {
   };
   CEPH_RADOS_API std::ostream& operator<<(std::ostream& os, const librados::ObjectCursor& oc);
 
-  class CEPH_RADOS_API NObjectIterator : public std::iterator <std::forward_iterator_tag, ListObject> {
+  class CEPH_RADOS_API NObjectIterator {
   public:
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = ListObject;
+    using difference_type = std::ptrdiff_t;
+    using pointer = ListObject*;
+    using reference = ListObject&;
+
     static const NObjectIterator __EndObjectIterator;
     NObjectIterator(): impl(NULL) {}
     ~NObjectIterator();
diff --git a/src/include/rangeset.h b/src/include/rangeset.h
index e7e3d047c72..f19af0b61e4 100644
--- a/src/include/rangeset.h
+++ b/src/include/rangeset.h
@@ -55,9 +55,14 @@ struct _rangeset_base {
 
 
 template <class T>
-class rangeset_iterator :
-  public std::iterator<std::input_iterator_tag, T>
+class rangeset_iterator
 {
+    using iterator_category = std::input_iterator_tag;
+    using value_type = T;
+    using difference_type = std::ptrdiff_t;
+    using pointer = T*;
+    using reference = T&;
+
   //typedef typename map<T,T>::iterator mapit;
 
   map<T,T> ranges;
diff --git a/src/include/xlist.h b/src/include/xlist.h
index 733a318a9bd..7e1ae49b246 100644
--- a/src/include/xlist.h
+++ b/src/include/xlist.h
@@ -159,10 +159,16 @@ public:
     remove(_back);
   }
 
-  class iterator: std::iterator<std::forward_iterator_tag, T> {
+  class iterator {
   private:
     item *cur;
   public:
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = T;
+    using difference_type = std::ptrdiff_t;
+    using pointer = T*;
+    using reference = T&;
+
     iterator(item *i = 0) : cur(i) {}
     T operator*() { return static_cast<T>(cur->_item); }
     iterator& operator++() {
@@ -183,10 +189,16 @@ public:
   iterator begin() { return iterator(_front); }
   iterator end() { return iterator(NULL); }
 
-  class const_iterator: std::iterator<std::forward_iterator_tag, T> {
+  class const_iterator {
   private:
     item *cur;
   public:
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = T;
+    using difference_type = std::ptrdiff_t;
+    using pointer = T*;
+    using reference = T&;
+
     const_iterator(item *i = 0) : cur(i) {}
     const T operator*() { return static_cast<const T>(cur->_item); }
     const_iterator& operator++() {
diff --git a/src/msg/async/dpdk/circular_buffer.h b/src/msg/async/dpdk/circular_buffer.h
index 2c92c120444..bf5d422dac6 100644
--- a/src/msg/async/dpdk/circular_buffer.h
+++ b/src/msg/async/dpdk/circular_buffer.h
@@ -89,8 +89,12 @@ class circular_buffer {
   size_t mask(size_t idx) const;
 
   template<typename CB, typename ValueType>
-  struct cbiterator : std::iterator<std::random_access_iterator_tag, ValueType> {
-    typedef std::iterator<std::random_access_iterator_tag, ValueType> super_t;
+  struct cbiterator {
+    using iterator_category = std::random_access_iterator_tag;
+    using value_type = ValueType;
+    using difference_type = std::ptrdiff_t;
+    using pointer = ValueType*;
+    using reference = ValueType&;
 
     ValueType& operator*() const { return cb->_impl.storage[cb->mask(idx)]; }
     ValueType* operator->() const { return &cb->_impl.storage[cb->mask(idx)]; }
@@ -116,17 +120,17 @@ class circular_buffer {
       idx--;
       return v;
     }
-    cbiterator<CB, ValueType> operator+(typename super_t::difference_type n) const {
+    cbiterator<CB, ValueType> operator+(difference_type n) const {
       return cbiterator<CB, ValueType>(cb, idx + n);
     }
-    cbiterator<CB, ValueType> operator-(typename super_t::difference_type n) const {
+    cbiterator<CB, ValueType> operator-(difference_type n) const {
       return cbiterator<CB, ValueType>(cb, idx - n);
     }
-    cbiterator<CB, ValueType>& operator+=(typename super_t::difference_type n) {
+    cbiterator<CB, ValueType>& operator+=(difference_type n) {
       idx += n;
       return *this;
     }
-    cbiterator<CB, ValueType>& operator-=(typename super_t::difference_type n) {
+    cbiterator<CB, ValueType>& operator-=(difference_type n) {
       idx -= n;
       return *this;
     }
@@ -148,7 +152,7 @@ class circular_buffer {
     bool operator<=(const cbiterator<CB, ValueType>& rhs) const {
       return idx <= rhs.idx;
     }
-    typename super_t::difference_type operator-(const cbiterator<CB, ValueType>& rhs) const {
+    difference_type operator-(const cbiterator<CB, ValueType>& rhs) const {
       return idx - rhs.idx;
     }
    private: