23 template <
typename Expr>
30 using iterator_category = std::random_access_iterator_tag;
32 using reference = decltype(std::declval<Expr>()[i]);
33 using pointer = std::add_pointer_t<decltype(std::declval<Expr>()[i])>;
41 iterator(Expr& expr,
size_t i) : expr(&expr), i(i) {}
57 return (*expr)[i + n];
163 return expr == other.expr && i == other.i;
172 return !(*
this == other);
iterator & operator-=(difference_type n)
Back away the iterator n positions.
Definition: iterator.hpp:121
iterator operator++(int)
Postincrement the iterator.
Definition: iterator.hpp:100
auto operator->()
Dereference the iterator to get the current value.
Definition: iterator.hpp:64
iterator operator-(difference_type n)
Creates a new iterator poiting to the current position minus n.
Definition: iterator.hpp:142
difference_type operator-(const iterator &it)
Computes the difference between two iterators.
Definition: iterator.hpp:153
iterator operator+(difference_type n)
Creates a new iterator poiting to the current position plus n.
Definition: iterator.hpp:131
reference operator*()
Dereference the iterator to get the current value.
Definition: iterator.hpp:47
decltype(std::declval< Expr >()[i]) reference
The type of reference.
Definition: iterator.hpp:32
size_t difference_type
The type used for subtracting two iterators.
Definition: iterator.hpp:34
bool operator!=(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:171
bool operator==(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:162
reference operator[](difference_type n)
Dereferences the iterator at n forward position.
Definition: iterator.hpp:56
bool operator<=(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:207
iterator & operator+=(difference_type n)
Advances the iterator n positions.
Definition: iterator.hpp:111
iterator operator--(int)
Postdecrement the iterator.
Definition: iterator.hpp:81
Root namespace for the ETL library.
Definition: adapter.hpp:15
bool operator<(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:198
Configurable iterator for ETL expressions.
Definition: iterator.hpp:24
bool operator>=(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:189
iterator(Expr &expr, size_t i)
Construct a new iterator.
Definition: iterator.hpp:41
iterator & operator++()
Preincrement the iterator.
Definition: iterator.hpp:91
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81
std::add_pointer_t< decltype(std::declval< Expr >()[i])> pointer
The type of pointer.
Definition: iterator.hpp:33
iterator & operator--()
Predecrement the iterator.
Definition: iterator.hpp:72
value_t< Expr > value_type
The value type.
Definition: iterator.hpp:31
bool operator>(const iterator &other) const
Compare two iterators.
Definition: iterator.hpp:180