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...
#include <ADS/Iterators.h>
|
| using | reference = decltype( P::read( std::declval< const O & >() , 0 ) ) |
| | what P::read() gives
|
| using | value_type = typename detail::ItemValue< reference >::type |
| | the items, the pair of the copies for a PairRef
|
| using | difference_type = std::ptrdiff_t |
| | the distances
|
| using | iterator_concept = std::bidirectional_iterator_tag |
| | bidirectional for the concepts of C++20
|
| using | iterator_category |
| | bidirectional for the older algorithms if P::read() gives a reference, input otherwise
|
template<class O, class P>
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
◆ difference_type
template<class O, class P>
◆ iterator_category
template<class O, class P>
Initial value:
std::conditional_t< std::is_reference_v< reference > ,
std::bidirectional_iterator_tag ,
std::input_iterator_tag >
bidirectional for the older algorithms if P::read() gives a reference, input otherwise
◆ iterator_concept
template<class O, class P>
bidirectional for the concepts of C++20
◆ reference
template<class O, class P>
| using ADS::SlotIterator< O, P >::reference = decltype( P::read( std::declval< const O & >() , 0 ) ) |
◆ value_type
template<class O, class P>
the items, the pair of the copies for a PairRef
◆ SlotIterator() [1/2]
template<class O, class P>
◆ SlotIterator() [2/2]
template<class O, class P>
on the first occupied place from \( i \), or at the end
◆ operator*()
template<class O, class P>
the item of the place, read by P::read()
◆ operator++() [1/2]
template<class O, class P>
to the next occupied place, returning the iterator before the step
◆ operator++() [2/2]
template<class O, class P>
to the next occupied place, or to the end \( m \)
In pseudocode (beyond the book), \( i \) the place and \( m \) the size of the table; a whole visit examines each place once:
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{procedure}\ \mathrm{next}() \cr
2 & \quad i \gets i + 1 \cr
3 & \quad \textbf{while}\ i < m\ \textbf{and not}\ \mathrm{occupied}( i
)\ \textbf{do}\ i \gets i + 1
\end{array}}
\]
◆ operator--() [1/2]
template<class O, class P>
to the previous occupied place, returning the iterator before the step
◆ operator--() [2/2]
template<class O, class P>
to the previous occupied place
In pseudocode (beyond the book), the step of operator++() backwards:
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{procedure}\ \mathrm{prev}() \cr
2 & \quad \textbf{repeat}\ i \gets i - 1\ \textbf{until}
\ \mathrm{occupied}( i )
\end{array}}
\]
- Precondition
- an occupied place precedes the current one
◆ operator==()
template<class O, class P>
◆ place()
template<class O, class P>
The documentation for this class was generated from the following file: