#pragma once #include #include // for std::size of C arrays namespace ranges::views { /// Returns a view of indexes into the given range template inline auto indexes(Rng&& rng) noexcept { using std::size; using index_t = decltype(size(rng)); return ranges::views::iota(index_t { 0 }, size(rng)); } }