Class SeqIterator

Synopsis

#include <include/rapidcheck/seq/SeqIterator.h>

template <typename T>
class SeqIterator : public std::iterator<std::input_iterator_tag, T>

Description

STL iterator for Seq.

Inheritance

Ancestors: std::iterator< std::input_iterator_tag, T >

Methods

SeqIterator overloadCreates a new past-the-end SeqIterator.
SeqIterator overloadCreates a new iterator pointing to the beginning of the given Seq.
operator* overload
operator++ overload
operator==

Source

Lines 7-25 in include/rapidcheck/seq/SeqIterator.h.

template <typename T>
class SeqIterator : public std::iterator<std::input_iterator_tag, T> {
public:
  /// Creates a new past-the-end `SeqIterator`.
  SeqIterator() = default;

  /// Creates a new iterator pointing to the beginning of the given `Seq`.
  explicit SeqIterator(Seq<T> seq);

  bool operator==(const SeqIterator<T> &rhs) const;
  T &operator*();
  const T &operator*() const;
  SeqIterator &operator++();
  SeqIterator operator++(int);

private:
  Seq<T> m_seq;
  Maybe<T> m_current;
};





Add Discussion as Guest

Log in