ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::IndexIterator< C, V, Next, Value, Const > Class Template Reference

a forward iterator along the cells C of a vector linked by the index in the member Next, on the items V in the member Value; -1 is the end More...

#include <ADS/Iterators.h>

Public types

using iterator_category = std::forward_iterator_tag
 forward
using value_type = V
 the items
using difference_type = std::ptrdiff_t
 the distances
using reference = std::conditional_t< Const , const V & , V & >
 a reference to an item, constant if Const
using pointer = std::conditional_t< Const , const V * , V * >
 a pointer to an item, constant if Const

Public member functions

 IndexIterator (void)=default
 the end
 IndexIterator (Cells *A, int c)
 on the item of the cell \( A[ c ] \), the end if \( c = -1 \)
template<bool K>
requires ( Const && ! K )
 IndexIterator (const IndexIterator< C, V, Next, Value, K > &o)
 the constant iterator from the mutable one
reference operator* (void) const
 the item
pointer operator-> (void) const
 the address of the item
IndexIterator & operator++ (void)
 to the next cell, by the index Next
IndexIterator operator++ (int)
 to the next cell, returning the iterator before the step
bool operator== (const IndexIterator &o) const
 equal on the same cell; any two ends are equal
Cells * cells (void) const
 the vector of the cells
int index (void) const
 the index of the cell, -1 at the end

Detailed description

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
class ADS::IndexIterator< C, V, Next, Value, Const >

a forward iterator along the cells C of a vector linked by the index in the member Next, on the items V in the member Value; -1 is the end

Member typedef documentation

◆ difference_type

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
using ADS::IndexIterator< C, V, Next, Value, Const >::difference_type = std::ptrdiff_t

the distances

◆ iterator_category

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
using ADS::IndexIterator< C, V, Next, Value, Const >::iterator_category = std::forward_iterator_tag

forward

◆ pointer

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
using ADS::IndexIterator< C, V, Next, Value, Const >::pointer = std::conditional_t< Const , const V * , V * >

a pointer to an item, constant if Const

◆ reference

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
using ADS::IndexIterator< C, V, Next, Value, Const >::reference = std::conditional_t< Const , const V & , V & >

a reference to an item, constant if Const

◆ value_type

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
using ADS::IndexIterator< C, V, Next, Value, Const >::value_type = V

the items

Constructor and destructor documentation

◆ IndexIterator() [1/3]

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
ADS::IndexIterator< C, V, Next, Value, Const >::IndexIterator ( void )
default

the end

◆ IndexIterator() [2/3]

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
ADS::IndexIterator< C, V, Next, Value, Const >::IndexIterator ( Cells * A,
int c )
inline

on the item of the cell \( A[ c ] \), the end if \( c = -1 \)

◆ IndexIterator() [3/3]

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
template<bool K>
requires ( Const && ! K )
ADS::IndexIterator< C, V, Next, Value, Const >::IndexIterator ( const IndexIterator< C, V, Next, Value, K > & o)
inline

the constant iterator from the mutable one

Member function documentation

◆ cells()

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
Cells * ADS::IndexIterator< C, V, Next, Value, Const >::cells ( void ) const
inlinenodiscard

the vector of the cells

◆ index()

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
int ADS::IndexIterator< C, V, Next, Value, Const >::index ( void ) const
inlinenodiscard

the index of the cell, -1 at the end

◆ operator*()

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
reference ADS::IndexIterator< C, V, Next, Value, Const >::operator* ( void ) const
inline

the item

◆ operator++() [1/2]

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
IndexIterator ADS::IndexIterator< C, V, Next, Value, Const >::operator++ ( int )
inline

to the next cell, returning the iterator before the step

◆ operator++() [2/2]

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
IndexIterator & ADS::IndexIterator< C, V, Next, Value, Const >::operator++ ( void )
inline

to the next cell, by the index Next

◆ operator->()

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
pointer ADS::IndexIterator< C, V, Next, Value, Const >::operator-> ( void ) const
inline

the address of the item

◆ operator==()

template<class C, class V, int C::* Next, V C::* Value, bool Const = true>
bool ADS::IndexIterator< C, V, Next, Value, Const >::operator== ( const IndexIterator< C, V, Next, Value, Const > & o) const
inline

equal on the same cell; any two ends are equal


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