std::ranges::zip_view<Views...>::iterator<Const>::operator[]

From cppreference.com
< cpp‎ | ranges‎ | zip view‎ | iterator
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
constexpr auto operator[]( difference_type n ) const
    requires /*all-random-access*/<Const, Views...>;
(since C++23)

Obtains a std::tuple that consists of underlying pointed-to elements at given offset relative to current location.

Equivalent to:

return /*tuple-transform*/([&]<class I>(I& i) -> decltype(auto) {
           return i[iter_difference_t<I>(n)];
       }, current_);

Parameters

n - position relative to current location

Return value

The obtained tuple-like element.

Example