|
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 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 1039 of file ah-stl-zip.H.
| using Aleph::StlEnumerateIterator< Container >::difference_type = std::ptrdiff_t |
Definition at line 1043 of file ah-stl-zip.H.
| using Aleph::StlEnumerateIterator< Container >::iterator_category = std::input_iterator_tag |
Definition at line 1042 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 1044 of file ah-stl-zip.H.
|
inlineexplicitconstexpr |
Definition at line 1052 of file ah-stl-zip.H.
|
inlineconstexpr |
Definition at line 1058 of file ah-stl-zip.H.
|
inlineconstexpr |
Definition at line 1063 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 1061 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 1065 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 1084 of file ah-stl-zip.H.
References Aleph::maps().
|
inlineconstexpr |
Definition at line 1071 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::get_curr().
|
inlineconstexprnoexcept |
Definition at line 1073 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::next().
|
inlineconstexprnoexcept |
Definition at line 1079 of file ah-stl-zip.H.
References Aleph::StlEnumerateIterator< Container >::has_curr(), and Aleph::maps().
|
private |
Definition at line 1047 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 1048 of file ah-stl-zip.H.
Referenced by Aleph::StlEnumerateIterator< Container >::has_curr().
|
private |
Definition at line 1049 of file ah-stl-zip.H.
Referenced by Aleph::StlEnumerateIterator< Container >::get_curr(), and Aleph::StlEnumerateIterator< Container >::next().