|
Py2Cpp 1.6.3; VERSION ${PROJECT_VERSION}
|
Iterator for enumerated access to container elements. More...
#include <enumerate.hpp>
Public Types | |
| using | TIter = decltype(std::begin(std::declval< T >())) |
| using | iter_ref = typename std::iterator_traits< TIter >::reference |
Public Member Functions | |
| auto | operator!= (const EnumerateIterator &other) const -> bool |
| Check inequality between iterators. | |
| EnumerateIterator & | operator++ () |
| Pre-increment operator. | |
| auto | operator* () -> std::pair< size_t, iter_ref > |
| Dereference operator. | |
Public Attributes | |
| size_t | i |
| TIter | iter |
Iterator for enumerated access to container elements.
Provides iterator functionality that yields index-value pairs when iterating over containers, similar to Python's enumerate() function.
| T | The container or range type to enumerate |
| using py::detail::EnumerateIterator< T >::iter_ref = typename std::iterator_traits<TIter>::reference |
| using py::detail::EnumerateIterator< T >::TIter = decltype(std::begin(std::declval<T>())) |
|
inline |
Check inequality between iterators.
Compares the underlying iterators to determine if they point to different elements.
| [in] | other | The other iterator to compare with |
|
inline |
Dereference operator.
Returns a pair containing the current index and a reference to the element.
|
inline |
Pre-increment operator.
Increments both the index counter and the underlying iterator.
| size_t py::detail::EnumerateIterator< T >::i |
| TIter py::detail::EnumerateIterator< T >::iter |