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
|
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/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:
|