72 lines
2.7 KiB
Diff
72 lines
2.7 KiB
Diff
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:
|