|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator that pairs each element with its index. More...
#include <ah-stl-zip.H>
Classes | |
| struct | end_tag |
Public Types | |
| using | iterator_category = std::input_iterator_tag |
| using | difference_type = std::ptrdiff_t |
| using | value_type = std::tuple< size_t, typename std::decay_t< Container >::value_type > |
Public Member Functions | |
| constexpr | StlEnumerateIterator (const Container &c) |
| constexpr | StlEnumerateIterator (const Container &c, end_tag) |
| constexpr bool | has_curr () const noexcept |
| constexpr auto | get_curr () const |
| constexpr void | next () noexcept |
| constexpr void | next_ne () noexcept |
Advance without checking; same as next(), which does not check. | |
| constexpr auto | operator* () const |
| constexpr StlEnumerateIterator & | operator++ () noexcept |
| constexpr bool | operator== (const StlEnumerateIterator &other) const noexcept |
| constexpr bool | operator!= (const StlEnumerateIterator &other) const noexcept |
Private Attributes | |
| std::decay_t< Container >::const_iterator | curr_ |
| std::decay_t< Container >::const_iterator | end_ |
| size_t | index_ = 0 |
Iterator that pairs each element with its index.
Similar to Python's enumerate(). Produces tuples of (index, element).
Definition at line 1046 of file ah-stl-zip.H.
| using Aleph::StlEnumerateIterator< Container >::difference_type = std::ptrdiff_t |
Definition at line 1050 of file ah-stl-zip.H.
| using Aleph::StlEnumerateIterator< Container >::iterator_category = std::input_iterator_tag |
Definition at line 1049 of file ah-stl-zip.H.
| using Aleph::StlEnumerateIterator< Container >::value_type = std::tuple<size_t, typename std::decay_t<Container>::value_type> |
Definition at line 1051 of file ah-stl-zip.H.
|
inlineexplicitconstexpr |
Definition at line 1059 of file ah-stl-zip.H.
|
inlineconstexpr |
Definition at line 1065 of file ah-stl-zip.H.
|
inlineconstexpr |
Definition at line 1070 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::curr_, and Aleph::StlEnumerateIterator< Container >::index_.
Referenced by Aleph::StlEnumerateIterator< Container >::operator*().
|
inlineconstexprnoexcept |
Definition at line 1068 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::curr_, and Aleph::StlEnumerateIterator< Container >::end_.
Referenced by Aleph::StlEnumerateIterator< Container >::operator==().
|
inlineconstexprnoexcept |
Definition at line 1072 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::curr_, and Aleph::StlEnumerateIterator< Container >::index_.
Referenced by Aleph::StlEnumerateIterator< Container >::next_ne(), and Aleph::StlEnumerateIterator< Container >::operator++().
|
inlineconstexprnoexcept |
Advance without checking; same as next(), which does not check.
Provided so the iterator satisfies AlephIterator and works in generic code that advances with next_ne() under a has_curr() guard.
Definition at line 1083 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::next().
|
inlineconstexprnoexcept |
Definition at line 1098 of file ah-stl-zip.H.
References Aleph::blossom_maximum_cardinality_matching().
|
inlineconstexpr |
Definition at line 1085 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::get_curr().
|
inlineconstexprnoexcept |
Definition at line 1087 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::next().
|
inlineconstexprnoexcept |
Definition at line 1093 of file ah-stl-zip.H.
References Aleph::and, Aleph::blossom_maximum_cardinality_matching(), and Aleph::StlEnumerateIterator< Container >::has_curr().
|
private |
Definition at line 1054 of file ah-stl-zip.H.
Referenced by Aleph::StlEnumerateIterator< Container >::get_curr(), Aleph::StlEnumerateIterator< Container >::has_curr(), and Aleph::StlEnumerateIterator< Container >::next().
|
private |
Definition at line 1055 of file ah-stl-zip.H.
Referenced by Aleph::StlEnumerateIterator< Container >::has_curr().
|
private |
Definition at line 1056 of file ah-stl-zip.H.
Referenced by Aleph::StlEnumerateIterator< Container >::get_curr(), and Aleph::StlEnumerateIterator< Container >::next().