cpp / latest / ranges / zip_view / iterator.html /

std::ranges::zip_view<Views...>::iterator

template< bool Const >
class /*iterator*/;             // exposition only
(1) (since C++23)
Helper concepts
template< bool C, class... Views >
concept /*all-forward*/ =       // exposition only
    (ranges::forward_range<std::conditional_t<C, const Views, Views>> && ...);
(2) (since C++23)
template< bool C, class... Views >
concept /*all-bidirectional*/ = // exposition only
    (ranges::bidirectional_range<std::conditional_t<C, const Views, Views>> && ...);
(3) (since C++23)
template< bool C, class... Views >
concept /*all-random-access*/ = // exposition only
    (ranges::random_access_range<std::conditional_t<C, const Views, Views>> && ...);
(4) (since C++23)

The iterator type of a possibly const-qualified zip_view, returned by zip_view::begin and in certain cases by zip_view::end. The name of this class template (shown here as iterator) is unspecified.

The type /*iterator*/<true> or /*iterator*/<false> treats the underlying view as const-qualified or non-const-qualified respectively.

Member types

Member type Definition
iterator_concept std::random_access_iterator_tag if /*all-random-access*/<Const, Views...> is true, otherwise
std::bidirectional_iterator_tag if /*all-bidirectional*/<Const, Views...> is true, otherwise
std::forward_iterator_tag if /*all-forward*/<Const, Views...> is true, otherwise
std::input_iterator_tag
iterator_category std::input_iterator_tag if /*all-forward*/<Const, Views...> is true,
not defined otherwise
value_type If sizeof...(Views) is equal to 2:

Otherwise,

difference_type std::common_type_t<ranges::range_difference_t<Views>...> if Const is false,
std::common_type_t<ranges::range_difference_t<const Views>...> otherwise.

Data members

Typical implementations of iterator hold only one non-static data member: a std::tuple<ranges::iterator_t<Views>...> or std::tuple<ranges::iterator_t<const Views>...> when Const is false or true respectively.

For the purpose of exposition, the underlying iterators in that std::tuple are shown as is_... here.

Member functions

(C++23)
constructs an iterator
(public member function)
(C++23)
obtains a tuple-like value that consists of underlying pointed-to elements
(public member function)
(C++23)
obtains a tuple-like value that consists of underlying elements at given offset
(public member function)
(C++23)
advances or decrements the underlying iterators
(public member function)

Non-member functions

(C++23)
compares the underlying iterators
(function)
(C++23)
performs iterator arithmetic on underlying iterators
(function)
(C++23)
obtains a tuple-like value that denotes underlying pointed-to elements to be moved
(function)
(C++23)
swaps underlying pointed-to elements
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/zip_view/iterator