Skip to content

Commit

Permalink
do not derive from std::iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteemann committed Feb 7, 2022
1 parent 5940240 commit 16fb37b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/velocypack/Iterator.h
Expand Up @@ -34,9 +34,13 @@

namespace arangodb::velocypack {

class ArrayIterator : public std::iterator<std::forward_iterator_tag, Slice> {
class ArrayIterator {
public:
using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = Slice;
using pointer = Slice*;
using reference = Slice&;

struct Empty {};

Expand Down Expand Up @@ -190,10 +194,16 @@ struct ObjectIteratorPair {
Slice const value;
};

class ObjectIterator : public std::iterator<std::forward_iterator_tag, ObjectIteratorPair> {
class ObjectIterator {
public:
using ObjectPair = ObjectIteratorPair;

using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = ObjectIteratorPair;
using pointer = ObjectIteratorPair*;
using reference = ObjectIteratorPair&;

ObjectIterator() = delete;

// The useSequentialIteration flag indicates whether or not the iteration
Expand Down

0 comments on commit 16fb37b

Please sign in to comment.