mirror of
https://github.com/mikage-emu/mikage-dev.git
synced 2025-01-09 06:50:59 +01:00
16 lines
377 B
C++
16 lines
377 B
C++
#pragma once
|
|
|
|
#include <range/v3/view/iota.hpp>
|
|
#include <iterator> // for std::size of C arrays
|
|
|
|
namespace ranges::views {
|
|
|
|
/// Returns a view of indexes into the given range
|
|
template<random_access_range Rng>
|
|
inline auto indexes(Rng&& rng) noexcept {
|
|
using std::size;
|
|
using index_t = decltype(size(rng));
|
|
return ranges::views::iota(index_t { 0 }, size(rng));
|
|
}
|
|
|
|
}
|