25template<
typename Iterable,
26 typename Iter =
decltype(std::begin(std::declval<Iterable>())),
27 typename =
decltype(std::end (std::declval<Iterable>()))>
34 [[nodiscard]]
constexpr bool operator==(
const iterator& other)
const {
35 return iter == other.iter;
38 [[nodiscard]]
constexpr bool operator==(
const Iter& other)
const {
42 constexpr void operator++() {
46 constexpr auto operator*()
const {
47 return std::tie(i, *iter);
51 struct iterable_wrapper {
54 constexpr auto begin() {
55 return iterator{0, std::begin(iterable)};
57 constexpr auto end() {
58 return std::end(iterable);
62 return iterable_wrapper{std::forward<Iterable>(iterable)};
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
constexpr auto begin(const zstring_view &x)
constexpr auto end(const zstring_view &x)