@@ -89,8 +89,12 @@ class circular_buffer {
8989 size_t mask (size_t idx) const ;
9090
9191 template <typename CB, typename ValueType>
92- struct cbiterator : std::iterator<std::random_access_iterator_tag, ValueType> {
93- typedef std::iterator<std::random_access_iterator_tag, ValueType> super_t ;
92+ struct cbiterator {
93+ using iterator_category = std::random_access_iterator_tag;
94+ using value_type = ValueType;
95+ using difference_type = std::ptrdiff_t ;
96+ using pointer = ValueType*;
97+ using reference = ValueType&;
9498
9599 ValueType& operator *() const { return cb->_impl .storage [cb->mask (idx)]; }
96100 ValueType* operator ->() const { return &cb->_impl .storage [cb->mask (idx)]; }
@@ -116,17 +120,17 @@ class circular_buffer {
116120 idx--;
117121 return v;
118122 }
119- cbiterator<CB, ValueType> operator +(typename super_t :: difference_type n) const {
123+ cbiterator<CB, ValueType> operator +(difference_type n) const {
120124 return cbiterator<CB, ValueType>(cb, idx + n);
121125 }
122- cbiterator<CB, ValueType> operator -(typename super_t :: difference_type n) const {
126+ cbiterator<CB, ValueType> operator -(difference_type n) const {
123127 return cbiterator<CB, ValueType>(cb, idx - n);
124128 }
125- cbiterator<CB, ValueType>& operator +=(typename super_t :: difference_type n) {
129+ cbiterator<CB, ValueType>& operator +=(difference_type n) {
126130 idx += n;
127131 return *this ;
128132 }
129- cbiterator<CB, ValueType>& operator -=(typename super_t :: difference_type n) {
133+ cbiterator<CB, ValueType>& operator -=(difference_type n) {
130134 idx -= n;
131135 return *this ;
132136 }
@@ -148,7 +152,7 @@ class circular_buffer {
148152 bool operator <=(const cbiterator<CB, ValueType>& rhs) const {
149153 return idx <= rhs.idx ;
150154 }
151- typename super_t :: difference_type operator -(const cbiterator<CB, ValueType>& rhs) const {
155+ difference_type operator -(const cbiterator<CB, ValueType>& rhs) const {
152156 return idx - rhs.idx ;
153157 }
154158 private:
0 commit comments