Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
ext::const_tuple_foreach_iterator< Iterators > Class Template Reference

A class for packing a tuple of iterators and synchronizing them. All are incremented, decremented, dereferenced together. More...

#include <foreach.hpp>

Public Member Functions

 const_tuple_foreach_iterator (Iterators ... it)
 Constructor of the iterator tuple from a pack of iterators. More...
 
template<size_t I>
decltype(std::get< I >(current)) base () const
 Getter of an Ith iterator from the tuple of underlying iterators. More...
 
template<size_t ... I>
ext::tuple< const typename Iterators::value_type &... > operator* () const
 Implementation of dereference operator on all iterators in the tuple. More...
 
const_tuple_foreach_iteratoroperator++ ()
 Prefix version of increment operator that propagates the call to all underlying iterators. More...
 
const_tuple_foreach_iteratoroperator-- ()
 Prefix version of decrement operator that propagates the call to all underlying iterators. More...
 
const_tuple_foreach_iterator operator++ (int)
 Postfix version of increment operator that propagates the call to all underlying iterators. More...
 
const_tuple_foreach_iterator operator-- (int)
 Postfix version of decrement operator that propagates the call to all underlying iterators. More...
 
bool operator== (const const_tuple_foreach_iterator< Iterators ... > &other) const
 Implementation of equality comparison operator on tuple of iterators. More...
 
bool operator!= (const const_tuple_foreach_iterator< Iterators ... > &other) const
 Implementation of inequality comparison operator on tuple of iterators. More...
 

Detailed Description

template<class ... Iterators>
class ext::const_tuple_foreach_iterator< Iterators >

A class for packing a tuple of iterators and synchronizing them. All are incremented, decremented, dereferenced together.

Constructor & Destructor Documentation

◆ const_tuple_foreach_iterator()

template<class ... Iterators>
ext::const_tuple_foreach_iterator< Iterators >::const_tuple_foreach_iterator ( Iterators ...  it)
inlineexplicit

Constructor of the iterator tuple from a pack of iterators.

Parameters
it... pack of iterators

Member Function Documentation

◆ base()

template<class ... Iterators>
template<size_t I>
decltype(std::get< I >(current)) ext::const_tuple_foreach_iterator< Iterators >::base ( ) const
inline

Getter of an Ith iterator from the tuple of underlying iterators.

Template Parameters
Ithe specification of the iterator index.

◆ operator!=()

template<class ... Iterators>
bool ext::const_tuple_foreach_iterator< Iterators >::operator!= ( const const_tuple_foreach_iterator< Iterators ... > &  other) const
inline

Implementation of inequality comparison operator on tuple of iterators.

Parameters
otherthe other instance to compare with
Returns
bool true if iterators of this class are not equal to iterators of the other class

◆ operator*()

template<class ... Iterators>
template<size_t ... I>
ext::tuple< const typename Iterators::value_type &... > ext::const_tuple_foreach_iterator< Iterators >::operator* ( ) const
inline

Implementation of dereference operator on all iterators in the tuple.

Returns
a tuple of values the individual iterators refer to

◆ operator++() [1/2]

template<class ... Iterators>
const_tuple_foreach_iterator & ext::const_tuple_foreach_iterator< Iterators >::operator++ ( )
inline

Prefix version of increment operator that propagates the call to all underlying iterators.

Returns
this

◆ operator++() [2/2]

template<class ... Iterators>
const_tuple_foreach_iterator ext::const_tuple_foreach_iterator< Iterators >::operator++ ( int  )
inline

Postfix version of increment operator that propagates the call to all underlying iterators.

Returns
original value

◆ operator--() [1/2]

template<class ... Iterators>
const_tuple_foreach_iterator & ext::const_tuple_foreach_iterator< Iterators >::operator-- ( )
inline

Prefix version of decrement operator that propagates the call to all underlying iterators.

Returns
this

◆ operator--() [2/2]

template<class ... Iterators>
const_tuple_foreach_iterator ext::const_tuple_foreach_iterator< Iterators >::operator-- ( int  )
inline

Postfix version of decrement operator that propagates the call to all underlying iterators.

Returns
original value

◆ operator==()

template<class ... Iterators>
bool ext::const_tuple_foreach_iterator< Iterators >::operator== ( const const_tuple_foreach_iterator< Iterators ... > &  other) const
inline

Implementation of equality comparison operator on tuple of iterators.

Parameters
otherthe other instance to compare with
Returns
bool true if iterators of this class are equal to iterators of the other class

The documentation for this class was generated from the following file: