template<typename DerivedT, typename IteratorCategoryT, typename T, typename DifferenceTypeT = std::ptrdiff_t, typename PointerT = T*, typename ReferenceT = T&>
slang::iterator_facade class


Base class that hides most of the iterator boilerplate from you. Derive from this template and then implement methods as follows:

Forward Iterators: (All of the following methods)

  • DerivedT &operator=(const DerivedT& R);
  • bool operator==(const DerivedT& R) const;
  • const T& operator*() const;
  • T& operator*();
  • DerivedT& operator++();

Bidirectional Iterators: (All methods of forward iterators, plus the following)

  • DerivedT& operator--();

Random-access Iterators: (All methods of bidirectional iterators excluding the following)

  • DerivedT& operator++();
  • DerivedT& operator--(); (and plus the following)
  • bool operator<(const DerivedT& RHS) const;
  • difference_type operator-(const DerivedT& R) const;
  • DerivedT& operator+=(difference_type N);
  • DerivedT& operator-=(difference_type N);

Protected types

class ReferenceProxy