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

a forward iterator along the cells C linked by the member Next, on the items V in the member Value; nil 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

 LinkedIterator (void)=default
 the end
 LinkedIterator (Cell *c)
 on the item of the cell \( c \), the end if \( c \) is nil
template<bool K>
requires ( Const && ! K )
 LinkedIterator (const LinkedIterator< 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
LinkedIterator & operator++ (void)
 to the next cell, by the link Next
LinkedIterator operator++ (int)
 to the next cell, returning the iterator before the step
bool operator== (const LinkedIterator &o) const =default
 equal on the same cell
Cell * cell (void) const
 the cell of the item, nil at the end

Detailed description

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

a forward iterator along the cells C linked by the member Next, on the items V in the member Value; nil is the end

Member typedef documentation

◆ difference_type

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

the distances

◆ iterator_category

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

forward

◆ pointer

template<class C, class V, C *C::* Next, V C::* Value, bool Const = true>
using ADS::LinkedIterator< 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, C *C::* Next, V C::* Value, bool Const = true>
using ADS::LinkedIterator< 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, C *C::* Next, V C::* Value, bool Const = true>
using ADS::LinkedIterator< C, V, Next, Value, Const >::value_type = V

the items

Constructor and destructor documentation

◆ LinkedIterator() [1/3]

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

the end

◆ LinkedIterator() [2/3]

template<class C, class V, C *C::* Next, V C::* Value, bool Const = true>
ADS::LinkedIterator< C, V, Next, Value, Const >::LinkedIterator ( Cell * c)
inlineexplicit

on the item of the cell \( c \), the end if \( c \) is nil

◆ LinkedIterator() [3/3]

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

the constant iterator from the mutable one

Member function documentation

◆ cell()

template<class C, class V, C *C::* Next, V C::* Value, bool Const = true>
Cell * ADS::LinkedIterator< C, V, Next, Value, Const >::cell ( void ) const
inlinenodiscard

the cell of the item, nil at the end

◆ operator*()

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

the item

◆ operator++() [1/2]

template<class C, class V, C *C::* Next, V C::* Value, bool Const = true>
LinkedIterator ADS::LinkedIterator< 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, C *C::* Next, V C::* Value, bool Const = true>
LinkedIterator & ADS::LinkedIterator< C, V, Next, Value, Const >::operator++ ( void )
inline

to the next cell, by the link Next

◆ operator->()

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

the address of the item

◆ operator==()

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

equal on the same cell


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