A C++ template library for embedded applications
MIT licensed
Designed and
maintained by
John Wellbelove
Support the development
of the ETL

Iterator

A set of templates to more easily determine the properties of iterator types.

____________________________________________________________________________________________________

Iterator concepts


Input

is_input_iterator<T>::value


Is T an input iterator?

is_input_iterator_concept<T>::value

Can T be used as an input iterator?

____________________________________________________________________________________________________

Output

is_output_iterator<T>::value


Is T an output iterator?

is_output_iterator_concept<T>::value

Can T be used as an output iterator?

____________________________________________________________________________________________________

Forward

is_forward_iterator<T>::value


Is T a forward iterator?

is_forward_iterator_concept<T>::value

Can T be used as an forward iterator?

____________________________________________________________________________________________________

Bidirectional

is_bidirectional_iterator<T>::value


Is T a bidirectional iterator?

is_bidirectional_iterator_concept<T>::value

Can T be used as a bidirectional iterator?

____________________________________________________________________________________________________

Random

is_random_iterator<T>::value


Is T a random iterator?

is_random_iterator_concept<T>::value

Can T be used as a random iterator?

____________________________________________________________________________________________________

Iterator tags


struct input_iterator_tag
struct output_iterator_tag
struct forward_iterator_tag
struct bidirectional_iterator_tag
struct random_access_iterator_tag

____________________________________________________________________________________________________

Iterator traits


template <typename TIterator>
struct iterator_traits

Defined types

iterator_category
value_type
difference_type
pointer
reference

____________________________________________________________________________________________________

advance


template <typename TIterator, typename TDistance>
ETL_CONSTEXPR17 void advance(TIterator& itr, TDistance n)

____________________________________________________________________________________________________

prev


template<typename TIterator>
ETL_CONSTEXPR17 TIterator prev(TIterator itr,
                               typename etl::iterator_traits<TIterator>::difference_type n = 1)


____________________________________________________________________________________________________

next


template<typename TIterator>
ETL_CONSTEXPR17 TIterator next(TIterator itr,
                               typename etl::iterator_traits<TIterator>::difference_type n = 1)



____________________________________________________________________________________________________

distance


template<typename TIterator>
ETL_CONSTEXPR17 typename std::iterator_traits<TIterator>::difference_type
distance(TIterator first, TIterator last)


____________________________________________________________________________________________________

iterator

A base class provided to simplify definitions of the required types for iterators.
https://en.cppreference.com/w/cpp/iterator/iterator

template <typename TCategory,
          typename T,
          typename TDistance = ptrdiff_t,
          typename TPointer = T* ,
          typename TReference = T&>
struct iterator

Defined types

value_type
difference_type
pointer
reference
iterator_category

____________________________________________________________________________________________________

reverse_iterator

An iterator adaptor that reverses the direction of a given iterator


template <typename TIterator>
class reverse_iterator

Defined types

iterator_category
value_type
iterator_type
difference_type
pointer
reference

____________________________________________________________________________________________________

move_iterator

An iterator adaptor that converts the value returned by the underlying iterator into an rvalue.
C++11 or above.


template <typename TIterator>
class move_iterator

Defined types

iterator_category
value_type
iterator_type
difference_type
pointer
reference
iterator.h