|
ADS
Algorithms and Data Structures
|
The iterators that the containers of the library have in common, beyond the book: they give a container the interface of the standard library (begin(), end(), the categories of the iterators), so that the range-for, the algorithms of std and of std::ranges, and those of Boost visit it. More...
#include <compare>#include <cstddef>#include <iterator>#include <tuple>#include <type_traits>#include <utility>#include <vector>#include <version>Go to the source code of this file.
Classes | |
| class | ADS::LinkedIterator< C, V, Next, Value, Const > |
| a forward iterator along the cells C linked by the member Next, on the items V in the member Value; nil is the end More... | |
| class | ADS::IndexIterator< C, V, Next, Value, Const > |
| a forward iterator along the cells C of a vector linked by the index in the member Next, on the items V in the member Value; -1 is the end More... | |
| class | ADS::CircularIterator< T, Const > |
| the random-access iterator on the items of a circular vector of the capacity \( c \) whose first item is at the place \( \mathit{head} \), the item \( i \) at the place \( ( \mathit{head} + i ) \bmod c \) More... | |
| 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 More... | |
| class | ADS::IndirectIterator< I > |
| the random-access iterator I on pointers read through them, *it being **base; the items are constant More... | |
| class | ADS::SlotIterator< O, P > |
| a bidirectional iterator on the occupied places of the table O, by the policy P with the static functions size( o ), occupied( o , i ) and read( o , i ); the items are constant More... | |
| class | ADS::KeyIterator< I > |
| the member first of what the iterator I reads, with the category of I up to bidirectional More... | |
| class | ADS::PathIterator< O, P > |
| a bidirectional iterator on the nodes of a binary tree of the owner O in symmetric order, by the policy P with the static functions root( o ), left( n ), right( n ) (nil for no child) and read( n ); the items are constant, and the end is the empty path More... | |
| class | ADS::WalkIterator< O, H, P > |
| a forward iterator on the nodes H (pointers or indices) of the owner O, from a first node, by the policy P with next( o , n , root ) and the constant none, the end, o being a pointer to the owner; *it is the node More... | |
Namespaces | |
| namespace | ADS |
Typedefs | |
| template<class A, class B, class VA = std::remove_cvref_t< A >, class VB = std::remove_cvref_t< B >> | |
| using | ADS::PairRef |
| the pair \( ( a , b ) \) that an iterator reads by value, in general two references into the container, whose value type is the pair of the copies \( ( V_A , V_B ) \), what std::ranges::range_value_t gives: the std::pair itself where the standard library declares the common reference of the two pairs (C++23, with \( V_A \) and \( V_B \) the types of \( a \) and \( b \)), a class derived from it that declares it otherwise | |
The iterators that the containers of the library have in common, beyond the book: they give a container the interface of the standard library (begin(), end(), the categories of the iterators), so that the range-for, the algorithms of std and of std::ranges, and those of Boost visit it.
LinkedIterator, IndexIterator, CircularIterator and RankIterator have a constant and a mutable form, by the parameter Const, and the mutable one converts to the constant one; IndirectIterator, SlotIterator, KeyIterator and PathIterator read constant items, and WalkIterator gives the nodes by value. An iterator stays valid as long as the cells (or the vector) it refers to do; the containers that keep an invariant on their items (a heap, a set) expose only the constant form. These are adaptors with no contracts of their own: the containers check theirs.