To illustrate what I mean: I have three objects:
Foo first, even, odd;
And I want to construct a view consisting of references to these objects like this: first&, odd&, even&, odd& ... up to N. To be able to iterate over them:
for (const auto & obj: my_view) {
// obj is equal to first&, odd&, even&, odd&... and so on
}
or pass the view to a function:
template <typename V>
void parse_elements(const V & v) {
// iterate over elements here
}
Is this possible with the most recent std::ranges or v3 ranges libraries without writing my own container class?