ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::SearchTree< K, V, RB >::const_iterator Class Reference

the constant iterator on the pairs, by increasing key More...

#include <ADS/tree/SearchTree.h>

Public types

using reference = PairRef< const K & , const V & >
 a pair of references to a key and its value
using value_type = std::pair< K , V >
 the pairs, by value
using difference_type = std::ptrdiff_t
 the type of the distances
using iterator_concept = std::bidirectional_iterator_tag
 bidirectional for the concepts of C++20
using iterator_category = std::input_iterator_tag
 input for the older algorithms, since *it is a value

Public member functions

 const_iterator (void)=default
 an iterator on no tree
 const_iterator (const SearchTree *t, Link *x)
 on the node \( x \) of the tree \( t \)
reference operator* (void) const
 the pair of the node
const_iterator & operator++ (void)
 to the next key, successorNode()
const_iterator & operator-- (void)
 to the previous key, from the end to the largest one
const_iterator operator++ (int)
 to the next key, returning the iterator before the step
const_iterator operator-- (int)
 to the previous key, returning the iterator before the step
bool operator== (const const_iterator &o) const
 equal on the same node
Link * node (void) const
 the node, the sentinel at the end

Detailed description

template<std::totally_ordered K, class V, bool RB>
class ADS::SearchTree< K, V, RB >::const_iterator

the constant iterator on the pairs, by increasing key

Member typedef documentation

◆ difference_type

template<std::totally_ordered K, class V, bool RB>
using ADS::SearchTree< K, V, RB >::const_iterator::difference_type = std::ptrdiff_t

the type of the distances

◆ iterator_category

template<std::totally_ordered K, class V, bool RB>
using ADS::SearchTree< K, V, RB >::const_iterator::iterator_category = std::input_iterator_tag

input for the older algorithms, since *it is a value

◆ iterator_concept

template<std::totally_ordered K, class V, bool RB>
using ADS::SearchTree< K, V, RB >::const_iterator::iterator_concept = std::bidirectional_iterator_tag

bidirectional for the concepts of C++20

◆ reference

template<std::totally_ordered K, class V, bool RB>
using ADS::SearchTree< K, V, RB >::const_iterator::reference = PairRef< const K & , const V & >

a pair of references to a key and its value

◆ value_type

template<std::totally_ordered K, class V, bool RB>
using ADS::SearchTree< K, V, RB >::const_iterator::value_type = std::pair< K , V >

the pairs, by value

Constructor and destructor documentation

◆ const_iterator() [1/2]

template<std::totally_ordered K, class V, bool RB>
ADS::SearchTree< K, V, RB >::const_iterator::const_iterator ( void )
default

an iterator on no tree

◆ const_iterator() [2/2]

template<std::totally_ordered K, class V, bool RB>
ADS::SearchTree< K, V, RB >::const_iterator::const_iterator ( const SearchTree * t,
Link * x )
inline

on the node \( x \) of the tree \( t \)

Member function documentation

◆ node()

template<std::totally_ordered K, class V, bool RB>
Link * ADS::SearchTree< K, V, RB >::const_iterator::node ( void ) const
inlinenodiscard

the node, the sentinel at the end

◆ operator*()

template<std::totally_ordered K, class V, bool RB>
reference ADS::SearchTree< K, V, RB >::const_iterator::operator* ( void ) const
inline

the pair of the node

◆ operator++() [1/2]

template<std::totally_ordered K, class V, bool RB>
const_iterator ADS::SearchTree< K, V, RB >::const_iterator::operator++ ( int )
inline

to the next key, returning the iterator before the step

◆ operator++() [2/2]

template<std::totally_ordered K, class V, bool RB>
const_iterator & ADS::SearchTree< K, V, RB >::const_iterator::operator++ ( void )
inline

to the next key, successorNode()

◆ operator--() [1/2]

template<std::totally_ordered K, class V, bool RB>
const_iterator ADS::SearchTree< K, V, RB >::const_iterator::operator-- ( int )
inline

to the previous key, returning the iterator before the step

◆ operator--() [2/2]

template<std::totally_ordered K, class V, bool RB>
const_iterator & ADS::SearchTree< K, V, RB >::const_iterator::operator-- ( void )
inline

to the previous key, from the end to the largest one

◆ operator==()

template<std::totally_ordered K, class V, bool RB>
bool ADS::SearchTree< K, V, RB >::const_iterator::operator== ( const const_iterator & o) const
inline

equal on the same node


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