ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::IndirectIterator< I > Class Template Reference

the random-access iterator I on pointers read through them, *it being **base; the items are constant More...

#include <ADS/Iterators.h>

Public types

using iterator_category = std::random_access_iterator_tag
 random access
using value_type = std::remove_cvref_t< decltype( **std::declval< I >() ) >
 the items, those pointed to
using difference_type = std::iter_difference_t< I >
 the distances, those of I
using reference = const value_type &
 a constant reference to an item
using pointer = const value_type *
 a constant pointer to an item

Public member functions

 IndirectIterator (void)=default
 an iterator on nothing
 IndirectIterator (I i)
 on the item pointed to by *i
reference operator* (void) const
 the item pointed to
pointer operator-> (void) const
 the address of the item pointed to
reference operator[] (difference_type k) const
 the item pointed to \( k \) places on
IndirectIterator & operator++ (void)
 to the next pointer
IndirectIterator & operator-- (void)
 to the previous pointer
IndirectIterator operator++ (int)
 to the next pointer, returning the iterator before the step
IndirectIterator operator-- (int)
 to the previous pointer, returning the iterator before the step
IndirectIterator & operator+= (difference_type k)
 \( k \) pointers on
IndirectIterator & operator-= (difference_type k)
 \( k \) pointers back
bool operator== (const IndirectIterator &o) const =default
 equal on the same pointer
auto operator<=> (const IndirectIterator &o) const =default
 the order of the iterators on the pointers
I base (void) const
 the iterator on the pointers

Friends

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

Detailed description

template<std::random_access_iterator I>
class ADS::IndirectIterator< I >

the random-access iterator I on pointers read through them, *it being **base; the items are constant

Member typedef documentation

◆ difference_type

template<std::random_access_iterator I>
using ADS::IndirectIterator< I >::difference_type = std::iter_difference_t< I >

the distances, those of I

◆ iterator_category

template<std::random_access_iterator I>
using ADS::IndirectIterator< I >::iterator_category = std::random_access_iterator_tag

random access

◆ pointer

template<std::random_access_iterator I>
using ADS::IndirectIterator< I >::pointer = const value_type *

a constant pointer to an item

◆ reference

template<std::random_access_iterator I>
using ADS::IndirectIterator< I >::reference = const value_type &

a constant reference to an item

◆ value_type

template<std::random_access_iterator I>
using ADS::IndirectIterator< I >::value_type = std::remove_cvref_t< decltype( **std::declval< I >() ) >

the items, those pointed to

Constructor and destructor documentation

◆ IndirectIterator() [1/2]

template<std::random_access_iterator I>
ADS::IndirectIterator< I >::IndirectIterator ( void )
default

an iterator on nothing

◆ IndirectIterator() [2/2]

template<std::random_access_iterator I>
ADS::IndirectIterator< I >::IndirectIterator ( I i)
inlineexplicit

on the item pointed to by *i

Member function documentation

◆ base()

template<std::random_access_iterator I>
I ADS::IndirectIterator< I >::base ( void ) const
inlinenodiscard

the iterator on the pointers

◆ operator*()

template<std::random_access_iterator I>
reference ADS::IndirectIterator< I >::operator* ( void ) const
inline

the item pointed to

◆ operator++() [1/2]

template<std::random_access_iterator I>
IndirectIterator ADS::IndirectIterator< I >::operator++ ( int )
inline

to the next pointer, returning the iterator before the step

◆ operator++() [2/2]

template<std::random_access_iterator I>
IndirectIterator & ADS::IndirectIterator< I >::operator++ ( void )
inline

to the next pointer

◆ operator+=()

template<std::random_access_iterator I>
IndirectIterator & ADS::IndirectIterator< I >::operator+= ( difference_type k)
inline

\( k \) pointers on

◆ operator--() [1/2]

template<std::random_access_iterator I>
IndirectIterator ADS::IndirectIterator< I >::operator-- ( int )
inline

to the previous pointer, returning the iterator before the step

◆ operator--() [2/2]

template<std::random_access_iterator I>
IndirectIterator & ADS::IndirectIterator< I >::operator-- ( void )
inline

to the previous pointer

◆ operator-=()

template<std::random_access_iterator I>
IndirectIterator & ADS::IndirectIterator< I >::operator-= ( difference_type k)
inline

\( k \) pointers back

◆ operator->()

template<std::random_access_iterator I>
pointer ADS::IndirectIterator< I >::operator-> ( void ) const
inline

the address of the item pointed to

◆ operator<=>()

template<std::random_access_iterator I>
auto ADS::IndirectIterator< I >::operator<=> ( const IndirectIterator< I > & o) const
default

the order of the iterators on the pointers

◆ operator==()

template<std::random_access_iterator I>
bool ADS::IndirectIterator< I >::operator== ( const IndirectIterator< I > & o) const
default

equal on the same pointer

◆ operator[]()

template<std::random_access_iterator I>
reference ADS::IndirectIterator< I >::operator[] ( difference_type k) const
inline

the item pointed to \( k \) places on

◆ operator+ [1/2]

template<std::random_access_iterator I>
IndirectIterator operator+ ( difference_type k,
IndirectIterator< I > a )
friend

◆ operator+ [2/2]

template<std::random_access_iterator I>
IndirectIterator operator+ ( IndirectIterator< I > a,
difference_type k )
friend

◆ operator- [1/2]

template<std::random_access_iterator I>
difference_type operator- ( const IndirectIterator< I > & a,
const IndirectIterator< I > & b )
friend

◆ operator- [2/2]

template<std::random_access_iterator I>
IndirectIterator operator- ( IndirectIterator< I > a,
difference_type k )
friend

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