ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::List< T, Pooled >::Iterator< Const > Class Template Reference

the iterator, on items const if Const More...

#include <ADS/sequence/List.h>

Public types

using iterator_category = std::bidirectional_iterator_tag
 the category of the iterator, bidirectional
using value_type = T
 the type of the items
using difference_type = std::ptrdiff_t
 the type of the distances
using reference = std::conditional_t< Const , const T & , T & >
 a reference to an item, constant if Const
using pointer = std::conditional_t< Const , const T * , T * >
 a pointer to an item, constant if Const

Public member functions

 Iterator (void)=default
 an iterator on no cell
 Iterator (Cell *c)
 on the item of the cell \( c \), the end if \( c \) is the sentinel
template<bool C>
requires ( Const && ! C )
 Iterator (const Iterator< C > &o)
 the const iterator from the other one
reference operator* (void) const
 the item
pointer operator-> (void) const
 the address of the item
Iterator & operator++ (void)
 to the next cell
Iterator operator++ (int)
 to the next cell, returning the iterator before the step
Iterator & operator-- (void)
 to the previous cell
Iterator operator-- (int)
 to the previous cell, returning the iterator before the step
bool operator== (const Iterator &o) const =default
 equal on the same cell
Cell * cell (void) const
 the cell, which is the position of the book

Detailed description

template<class T, bool Pooled = true>
template<bool Const>
class ADS::List< T, Pooled >::Iterator< Const >

the iterator, on items const if Const

Member typedef documentation

◆ difference_type

template<class T, bool Pooled = true>
template<bool Const>
using ADS::List< T, Pooled >::Iterator< Const >::difference_type = std::ptrdiff_t

the type of the distances

◆ iterator_category

template<class T, bool Pooled = true>
template<bool Const>
using ADS::List< T, Pooled >::Iterator< Const >::iterator_category = std::bidirectional_iterator_tag

the category of the iterator, bidirectional

◆ pointer

template<class T, bool Pooled = true>
template<bool Const>
using ADS::List< T, Pooled >::Iterator< Const >::pointer = std::conditional_t< Const , const T * , T * >

a pointer to an item, constant if Const

◆ reference

template<class T, bool Pooled = true>
template<bool Const>
using ADS::List< T, Pooled >::Iterator< Const >::reference = std::conditional_t< Const , const T & , T & >

a reference to an item, constant if Const

◆ value_type

template<class T, bool Pooled = true>
template<bool Const>
using ADS::List< T, Pooled >::Iterator< Const >::value_type = T

the type of the items

Constructor and destructor documentation

◆ Iterator() [1/3]

template<class T, bool Pooled = true>
template<bool Const>
ADS::List< T, Pooled >::Iterator< Const >::Iterator ( void )
default

an iterator on no cell

◆ Iterator() [2/3]

template<class T, bool Pooled = true>
template<bool Const>
ADS::List< T, Pooled >::Iterator< Const >::Iterator ( Cell * c)
inlineexplicit

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

◆ Iterator() [3/3]

template<class T, bool Pooled = true>
template<bool Const>
template<bool C>
requires ( Const && ! C )
ADS::List< T, Pooled >::Iterator< Const >::Iterator ( const Iterator< C > & o)
inline

the const iterator from the other one

Member function documentation

◆ cell()

template<class T, bool Pooled = true>
template<bool Const>
Cell * ADS::List< T, Pooled >::Iterator< Const >::cell ( void ) const
inlinenodiscard

the cell, which is the position of the book

◆ operator*()

template<class T, bool Pooled = true>
template<bool Const>
reference ADS::List< T, Pooled >::Iterator< Const >::operator* ( void ) const
inline

the item

◆ operator++() [1/2]

template<class T, bool Pooled = true>
template<bool Const>
Iterator ADS::List< T, Pooled >::Iterator< Const >::operator++ ( int )
inline

to the next cell, returning the iterator before the step

◆ operator++() [2/2]

template<class T, bool Pooled = true>
template<bool Const>
Iterator & ADS::List< T, Pooled >::Iterator< Const >::operator++ ( void )
inline

to the next cell

◆ operator--() [1/2]

template<class T, bool Pooled = true>
template<bool Const>
Iterator ADS::List< T, Pooled >::Iterator< Const >::operator-- ( int )
inline

to the previous cell, returning the iterator before the step

◆ operator--() [2/2]

template<class T, bool Pooled = true>
template<bool Const>
Iterator & ADS::List< T, Pooled >::Iterator< Const >::operator-- ( void )
inline

to the previous cell

◆ operator->()

template<class T, bool Pooled = true>
template<bool Const>
pointer ADS::List< T, Pooled >::Iterator< Const >::operator-> ( void ) const
inline

the address of the item

◆ operator==()

template<class T, bool Pooled = true>
template<bool Const>
bool ADS::List< T, Pooled >::Iterator< Const >::operator== ( const Iterator< Const > & o) const
default

equal on the same cell


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