ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::RankIterator< C, T, Const > Class Template Reference

the random-access iterator on the items of a container C read by rank, c[ i ] the item \( i \), of the type T More...

#include <ADS/Iterators.h>

Public types

using iterator_category = std::random_access_iterator_tag
 random access
using value_type = T
 the items
using difference_type = std::ptrdiff_t
 the distances
using reference = Item &
 a reference to an item
using pointer = Item *
 a pointer to an item

Public member functions

 RankIterator (void)=default
 an iterator on no container
 RankIterator (Owner *c, std::size_t i)
 on the item of rank \( i \) of c
template<bool K>
requires ( Const && ! K )
 RankIterator (const RankIterator< C, T, K > &o)
 the constant iterator from the mutable one
reference operator* (void) const
 the item
pointer operator-> (void) const
 the address of the item
reference operator[] (difference_type k) const
 the item \( k \) ranks on
RankIterator & operator++ (void)
 to the next item
RankIterator & operator-- (void)
 to the previous item
RankIterator operator++ (int)
 to the next item, returning the iterator before the step
RankIterator operator-- (int)
 to the previous item, returning the iterator before the step
RankIterator & operator+= (difference_type k)
 \( k \) items on
RankIterator & operator-= (difference_type k)
 \( k \) items back
bool operator== (const RankIterator &o) const
 equal on the same rank
std::strong_ordering operator<=> (const RankIterator &o) const
 the order of the ranks
Owner * owner (void) const
 the container
std::size_t rank (void) const
 the rank \( i \) of the item

Friends

RankIterator operator+ (RankIterator a, difference_type k)
RankIterator operator+ (difference_type k, RankIterator a)
RankIterator operator- (RankIterator a, difference_type k)
difference_type operator- (const RankIterator &a, const RankIterator &b)

Detailed description

template<class C, class T, bool Const = true>
class ADS::RankIterator< C, T, Const >

the random-access iterator on the items of a container C read by rank, c[ i ] the item \( i \), of the type T

Member typedef documentation

◆ difference_type

template<class C, class T, bool Const = true>
using ADS::RankIterator< C, T, Const >::difference_type = std::ptrdiff_t

the distances

◆ iterator_category

template<class C, class T, bool Const = true>
using ADS::RankIterator< C, T, Const >::iterator_category = std::random_access_iterator_tag

random access

◆ pointer

template<class C, class T, bool Const = true>
using ADS::RankIterator< C, T, Const >::pointer = Item *

a pointer to an item

◆ reference

template<class C, class T, bool Const = true>
using ADS::RankIterator< C, T, Const >::reference = Item &

a reference to an item

◆ value_type

template<class C, class T, bool Const = true>
using ADS::RankIterator< C, T, Const >::value_type = T

the items

Constructor and destructor documentation

◆ RankIterator() [1/3]

template<class C, class T, bool Const = true>
ADS::RankIterator< C, T, Const >::RankIterator ( void )
default

an iterator on no container

◆ RankIterator() [2/3]

template<class C, class T, bool Const = true>
ADS::RankIterator< C, T, Const >::RankIterator ( Owner * c,
std::size_t i )
inline

on the item of rank \( i \) of c

◆ RankIterator() [3/3]

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

the constant iterator from the mutable one

Member function documentation

◆ operator*()

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

the item

◆ operator++() [1/2]

template<class C, class T, bool Const = true>
RankIterator ADS::RankIterator< C, T, Const >::operator++ ( int )
inline

to the next item, returning the iterator before the step

◆ operator++() [2/2]

template<class C, class T, bool Const = true>
RankIterator & ADS::RankIterator< C, T, Const >::operator++ ( void )
inline

to the next item

◆ operator+=()

template<class C, class T, bool Const = true>
RankIterator & ADS::RankIterator< C, T, Const >::operator+= ( difference_type k)
inline

\( k \) items on

◆ operator--() [1/2]

template<class C, class T, bool Const = true>
RankIterator ADS::RankIterator< C, T, Const >::operator-- ( int )
inline

to the previous item, returning the iterator before the step

◆ operator--() [2/2]

template<class C, class T, bool Const = true>
RankIterator & ADS::RankIterator< C, T, Const >::operator-- ( void )
inline

to the previous item

◆ operator-=()

template<class C, class T, bool Const = true>
RankIterator & ADS::RankIterator< C, T, Const >::operator-= ( difference_type k)
inline

\( k \) items back

◆ operator->()

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

the address of the item

◆ operator<=>()

template<class C, class T, bool Const = true>
std::strong_ordering ADS::RankIterator< C, T, Const >::operator<=> ( const RankIterator< C, T, Const > & o) const
inline

the order of the ranks

◆ operator==()

template<class C, class T, bool Const = true>
bool ADS::RankIterator< C, T, Const >::operator== ( const RankIterator< C, T, Const > & o) const
inline

equal on the same rank

◆ operator[]()

template<class C, class T, bool Const = true>
reference ADS::RankIterator< C, T, Const >::operator[] ( difference_type k) const
inline

the item \( k \) ranks on

◆ owner()

template<class C, class T, bool Const = true>
Owner * ADS::RankIterator< C, T, Const >::owner ( void ) const
inlinenodiscard

the container

◆ rank()

template<class C, class T, bool Const = true>
std::size_t ADS::RankIterator< C, T, Const >::rank ( void ) const
inlinenodiscard

the rank \( i \) of the item

◆ operator+ [1/2]

template<class C, class T, bool Const = true>
RankIterator operator+ ( difference_type k,
RankIterator< C, T, Const > a )
friend

◆ operator+ [2/2]

template<class C, class T, bool Const = true>
RankIterator operator+ ( RankIterator< C, T, Const > a,
difference_type k )
friend

◆ operator- [1/2]

template<class C, class T, bool Const = true>
difference_type operator- ( const RankIterator< C, T, Const > & a,
const RankIterator< C, T, Const > & b )
friend

◆ operator- [2/2]

template<class C, class T, bool Const = true>
RankIterator operator- ( RankIterator< C, T, Const > a,
difference_type k )
friend

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