std::ranges...ew::iterator(3)
π
std::ranges::zip_view::iterator β a (3) page from the C++ Standard Library manual, bestie
okay so real talk, this is the <pink>C++ Standard Library</pink> section 3 page for std::ranges::zip_view::iterator, and honestly? it's giving iterator royalty. let me walk you through it π«Ά
β¨ NAME β¨
std::ranges::zip_view::iterator β literally the std::ranges::zip_view::iterator, that's the whole name, periodt π
πΈ SYNOPSIS πΈ
so first up we got the class template itself:
template< bool Const >
(1) (exposition
class /*iterator*/;
only*)
then the helper concepts π β these are the little sidekicks that make everything work:
template< bool C, class... Views >
concept /*all-forward*/ =
(2) (exposition
only*)
(ranges::forward_range<std::conditional_t<C, const Views,
Views>> && ...);
template< bool C, class... Views >
concept /*all-bidirectional*/ =
(3) (exposition
only*)
(ranges::bidirectional_range<std::conditional_t<C, const Views,
Views>> && ...);
template< bool C, class... Views >
concept /*all-random-access*/ =
(4) (exposition
only*)
(ranges::random_access_range<std::conditional_t<C, const Views,
Views>> && ...);
π¦ DESCRIPTION π¦
okay so picture this: this is the iterator type of a possibly const-qualified zip_view, and it gets returned by zip_view::begin and, in certain cases, by zip_view::end. yes she's popular, she gets around π
and the type /*iterator*/<true> or /*iterator*/<false> treats the underlying views as const-qualified or non-const-qualified respectively. that's the whole vibe check right there, no cap.
π MEMBER TYPES π
iterator_conceptβ here's the priority ladder, bestie, it works its way down:std::random_access_iterator_tagif/*all-random-access*/<Const, Views...>is true, otherwisestd::bidirectional_iterator_tagif/*all-bidirectional*/<Const, Views...>is true, otherwisestd::forward_iterator_tagif/*all-forward*/<Const, Views...>is true, otherwisestd::input_iterator_tag
iterator_categoryβstd::input_iterator_tagif/*all-forward*/<Const, Views...>is true,- not defined otherwise
value_typeβstd::tuple<ranges::range_value_t<Views>...>ifConstis false,std::tuple<ranges::range_value_t<const Views>...>otherwise.
difference_typeβstd::common_type_t<ranges::range_difference_t<Views>...>ifConstis false,std::common_type_t<ranges::range_difference_t<const Views>...>otherwise.
π DATA MEMBERS π
current_(private) β a tuple of underlying iterators of typestd::tuple<ranges::iterator_t<Views>...>orstd::tuple<ranges::iterator_t<const Views>...>whenConstis false or true respectively. also flagged as an (exposition-only member object*), iykyk π
β MEMBER FUNCTIONS β
constructor(C++23)β constructs an iterator (public member function)operator*(C++23)β obtains a tuple-like value that consists of underlying pointed-to elements (public member function)operator[](C++23)β obtains a tuple-like value that consists of underlying elements at given offset (public member function)operator++,operator++(int),operator--,operator--(int),operator+=,operator-=(C++23)β advances or decrements the underlying iterators (public member function)
π₯ NON-MEMBER FUNCTIONS π₯
operator==,operator<,operator>,operator<=,operator>=,operator<=>(C++23)β compares the underlying iterators (function)operator+,operator-(C++23)β performs iterator arithmetic on underlying iterators (function)iter_move(C++23)β obtains a tuple-like value that denotes underlying pointed-to elements to be moved (function)iter_swap(C++23)β swaps underlying pointed-to elements (function)
π real talk:iterator_categoryis not defined when/*all-forward*/<Const, Views...>is false. not "defined as something else", not "defined-ish" β not defined, periodt. don't come for her.
π§ SIGN-OFF π§
that's the whole page, bestie! this one came from http://cppreference.com, dated 2024.06.10, and it's the std::ranges...ew::iterator(3) page β go forth and zip your views, you absolute icon ππβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms