range-v3
range-v3 copied to clipboard
[request] Binding range in ranges::at or ranges::index
As a result of working with struct-of-arrays layout data, I often find I want to work with indices instead of the data itself (i.e. with argsort
/ argmax
type functions).
Range-v3 already makes this quite easy since you simply have to use a projector of the form [&rng](std::size_t i){return rng[i];}
or [&rng](std::size_t i){return rng.at(i);}
. However, I think this could be improved by providing the ability to construct a ranges::at_fn
or ranges::index_fn
with the range bound, which could then be used to index into that range.