ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::SequenceRange< S >::iterator Class Reference

a position of the sequence, read by *; the end is an iterator marked as such, equal to every iterator on a finished position More...

#include <ADS/sequence/SequenceRange.h>

Public types

using iterator_category = std::forward_iterator_tag
 the category of the iterator, forward
using value_type = typename S::Item
 the type of the items
using difference_type = std::ptrdiff_t
 the type of the distances
using reference = const value_type &
 a constant reference
using pointer = const value_type *
 a constant pointer

Public member functions

 iterator (void)=default
 an iterator on no sequence, at the end
 iterator (const S *s, typename S::Pos p)
 on the position \( p \) of the sequence \( s \)
reference operator* (void) const
 the item in the position, read( p )
pointer operator-> (void) const
 the address of the item in the position
iterator & operator++ (void)
 to the next position, next( p )
iterator operator++ (int)
 to the next position, returning the iterator before the step
bool operator== (std::default_sentinel_t) const
 at the end, i.e., on a finished position
bool operator== (const iterator &o) const
 equal if both are at the end, or on the same position
S::Pos position (void) const
 the position of the book

Static public member functions

static iterator end (const S *s)
 the end of the range of \( s \)

Detailed description

template<Sequence S>
class ADS::SequenceRange< S >::iterator

a position of the sequence, read by *; the end is an iterator marked as such, equal to every iterator on a finished position

Member typedef documentation

◆ difference_type

template<Sequence S>
using ADS::SequenceRange< S >::iterator::difference_type = std::ptrdiff_t

the type of the distances

◆ iterator_category

template<Sequence S>
using ADS::SequenceRange< S >::iterator::iterator_category = std::forward_iterator_tag

the category of the iterator, forward

◆ pointer

template<Sequence S>
using ADS::SequenceRange< S >::iterator::pointer = const value_type *

a constant pointer

◆ reference

template<Sequence S>
using ADS::SequenceRange< S >::iterator::reference = const value_type &

a constant reference

◆ value_type

template<Sequence S>
using ADS::SequenceRange< S >::iterator::value_type = typename S::Item

the type of the items

Constructor and destructor documentation

◆ iterator() [1/2]

template<Sequence S>
ADS::SequenceRange< S >::iterator::iterator ( void )
default

an iterator on no sequence, at the end

◆ iterator() [2/2]

template<Sequence S>
ADS::SequenceRange< S >::iterator::iterator ( const S * s,
typename S::Pos p )
inline

on the position \( p \) of the sequence \( s \)

Member function documentation

◆ end()

template<Sequence S>
iterator ADS::SequenceRange< S >::iterator::end ( const S * s)
inlinestatic

the end of the range of \( s \)

◆ operator*()

template<Sequence S>
reference ADS::SequenceRange< S >::iterator::operator* ( void ) const
inlinenodiscard

the item in the position, read( p )

◆ operator++() [1/2]

template<Sequence S>
iterator ADS::SequenceRange< S >::iterator::operator++ ( int )
inline

to the next position, returning the iterator before the step

◆ operator++() [2/2]

template<Sequence S>
iterator & ADS::SequenceRange< S >::iterator::operator++ ( void )
inline

to the next position, next( p )

◆ operator->()

template<Sequence S>
pointer ADS::SequenceRange< S >::iterator::operator-> ( void ) const
inlinenodiscard

the address of the item in the position

◆ operator==() [1/2]

template<Sequence S>
bool ADS::SequenceRange< S >::iterator::operator== ( const iterator & o) const
inlinenodiscard

equal if both are at the end, or on the same position

◆ operator==() [2/2]

template<Sequence S>
bool ADS::SequenceRange< S >::iterator::operator== ( std::default_sentinel_t ) const
inlinenodiscard

at the end, i.e., on a finished position

◆ position()

template<Sequence S>
S::Pos ADS::SequenceRange< S >::iterator::position ( void ) const
inlinenodiscard

the position of the book


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