add `enumerate`
Given an 'iterable', return a new iterable which iterates over a pair of index and elements of the original 'iterable'.
For example:
for ( auto [i,s] : LHCb::range::enumerate( std::array{0,1,4,9,16,25} ) ) {
assert( i*i == s );
}
The index starts, by default, at 0, and has a type of size_t
but this can be customised as well:
for ( auto [i,s] : LHCb::range::enumerate( std::array{4u,9u,16u,25u,36u}, 2u ) ) {
assert( i*i == s );
}
Edited by Rosen Matev