ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::SubscriptIterator< O, T > Class Template Reference

the random-access constant iterator on the items T of the owner O, read by ( *o )[ i ] More...

#include <ADS/succinct/BitVector.h>

Public types

using value_type = T
 the type of an item
using reference = T
 an item, returned by value
using difference_type = std::ptrdiff_t
 the type of the distance of two places
using iterator_concept = std::random_access_iterator_tag
 a random-access iterator, read in place
using iterator_category = std::input_iterator_tag
 an input iterator for the algorithms of before C++20, since its items are returned by value

Public member functions

 SubscriptIterator (void)=default
 an iterator on no owner
 SubscriptIterator (const O *o, std::size_t i)
 the iterator on the item \( i \) of *o
reference operator* (void) const
 the item
reference operator[] (difference_type k) const
 the item \( k \) places ahead
SubscriptIterator & operator++ (void)
 the next item
SubscriptIterator & operator-- (void)
 the previous item
SubscriptIterator operator++ (int)
 the next item, returning the iterator before it
SubscriptIterator operator-- (int)
 the previous item, returning the iterator before it
SubscriptIterator & operator+= (difference_type k)
 \( k \) places ahead
SubscriptIterator & operator-= (difference_type k)
 \( k \) places back
bool operator== (const SubscriptIterator &o) const
 whether the two iterators are on the same place
std::strong_ordering operator<=> (const SubscriptIterator &o) const
 the order of the places of the two iterators
std::size_t index (void) const
 the place of the item

Friends

SubscriptIterator operator+ (SubscriptIterator a, difference_type k)
 the iterator \( k \) places after \( a \)
SubscriptIterator operator+ (difference_type k, SubscriptIterator a)
 the iterator \( k \) places after \( a \)
SubscriptIterator operator- (SubscriptIterator a, difference_type k)
 the iterator \( k \) places before \( a \)
difference_type operator- (const SubscriptIterator &a, const SubscriptIterator &b)
 the places from \( b \) to \( a \)

Detailed description

template<class O, class T>
class ADS::SubscriptIterator< O, T >

the random-access constant iterator on the items T of the owner O, read by ( *o )[ i ]

Member typedef documentation

◆ difference_type

template<class O, class T>
using ADS::SubscriptIterator< O, T >::difference_type = std::ptrdiff_t

the type of the distance of two places

◆ iterator_category

template<class O, class T>
using ADS::SubscriptIterator< O, T >::iterator_category = std::input_iterator_tag

an input iterator for the algorithms of before C++20, since its items are returned by value

◆ iterator_concept

template<class O, class T>
using ADS::SubscriptIterator< O, T >::iterator_concept = std::random_access_iterator_tag

a random-access iterator, read in place

◆ reference

template<class O, class T>
using ADS::SubscriptIterator< O, T >::reference = T

an item, returned by value

◆ value_type

template<class O, class T>
using ADS::SubscriptIterator< O, T >::value_type = T

the type of an item

Constructor and destructor documentation

◆ SubscriptIterator() [1/2]

template<class O, class T>
ADS::SubscriptIterator< O, T >::SubscriptIterator ( void )
default

an iterator on no owner

◆ SubscriptIterator() [2/2]

template<class O, class T>
ADS::SubscriptIterator< O, T >::SubscriptIterator ( const O * o,
std::size_t i )
inline

the iterator on the item \( i \) of *o

Member function documentation

◆ index()

template<class O, class T>
std::size_t ADS::SubscriptIterator< O, T >::index ( void ) const
inlinenodiscard

the place of the item

◆ operator*()

template<class O, class T>
reference ADS::SubscriptIterator< O, T >::operator* ( void ) const
inline

the item

◆ operator++() [1/2]

template<class O, class T>
SubscriptIterator ADS::SubscriptIterator< O, T >::operator++ ( int )
inline

the next item, returning the iterator before it

◆ operator++() [2/2]

template<class O, class T>
SubscriptIterator & ADS::SubscriptIterator< O, T >::operator++ ( void )
inline

the next item

◆ operator+=()

template<class O, class T>
SubscriptIterator & ADS::SubscriptIterator< O, T >::operator+= ( difference_type k)
inline

\( k \) places ahead

◆ operator--() [1/2]

template<class O, class T>
SubscriptIterator ADS::SubscriptIterator< O, T >::operator-- ( int )
inline

the previous item, returning the iterator before it

◆ operator--() [2/2]

template<class O, class T>
SubscriptIterator & ADS::SubscriptIterator< O, T >::operator-- ( void )
inline

the previous item

◆ operator-=()

template<class O, class T>
SubscriptIterator & ADS::SubscriptIterator< O, T >::operator-= ( difference_type k)
inline

\( k \) places back

◆ operator<=>()

template<class O, class T>
std::strong_ordering ADS::SubscriptIterator< O, T >::operator<=> ( const SubscriptIterator< O, T > & o) const
inline

the order of the places of the two iterators

◆ operator==()

template<class O, class T>
bool ADS::SubscriptIterator< O, T >::operator== ( const SubscriptIterator< O, T > & o) const
inline

whether the two iterators are on the same place

◆ operator[]()

template<class O, class T>
reference ADS::SubscriptIterator< O, T >::operator[] ( difference_type k) const
inline

the item \( k \) places ahead

◆ operator+ [1/2]

template<class O, class T>
SubscriptIterator operator+ ( difference_type k,
SubscriptIterator< O, T > a )
friend

the iterator \( k \) places after \( a \)

◆ operator+ [2/2]

template<class O, class T>
SubscriptIterator operator+ ( SubscriptIterator< O, T > a,
difference_type k )
friend

the iterator \( k \) places after \( a \)

◆ operator- [1/2]

template<class O, class T>
difference_type operator- ( const SubscriptIterator< O, T > & a,
const SubscriptIterator< O, T > & b )
friend

the places from \( b \) to \( a \)

◆ operator- [2/2]

template<class O, class T>
SubscriptIterator operator- ( SubscriptIterator< O, T > a,
difference_type k )
friend

the iterator \( k \) places before \( a \)


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