22#ifndef _ITERTOOLS_ENUMERATE_HPP
23#define _ITERTOOLS_ENUMERATE_HPP
46 template <
typename Iter>
struct enum_iter : iterator_facade<enum_iter<Iter>, std::pair<long, typename std::iterator_traits<Iter>::value_type>> {
89 [[nodiscard]]
decltype(
auto)
dereference()
const {
return std::tuple<long,
decltype(*it)>{
i, *
it}; }
135 [[nodiscard]]
auto end() const noexcept {
return cend(); }
enumerated< R > enumerate(R &&rg)
Lazy-enumerate a given range (similar to Python's enumerate).
sentinel_t< Iter > make_sentinel(Iter it)
Create an itertools::sentinel_t from an iterator using template type deduction.
Provides a CRTP base class for various iterator types in itertools.
Provides a generic sentinel type for various iterator types in itertools.