std::ranges...ew::iterator(3)
π NAME π
std::ranges::zip_transform_view::iterator β that's the whole name, bestie, it's literally std::ranges::zip_transform_view::iterator, iconic and long and we respect it π
β¨ Synopsis β¨
template< bool Const > (since C++23)
class /*iterator*/; (exposition only*)
Ok so picture this: it's the iterator type of a possibly const-qualified zip_transform_view, and you get one back from zip_transform_view::begin and, in certain cases, from zip_transform_view::end. Slay.
And the tea on the template param: 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 π¦
πΈ Member types πΈ
Parent(private) βzip_transform_viewifConstisfalse,const zip_transform_viewotherwise. (exposition-only member type*)Base(private) βInnerViewifConstisfalse,const InnerViewotherwise. (exposition-only member type*)
Bestie, before we go any further, two little "let" definitions that everything else leans on:
Let /*maybe-const*/<Const, F>& denote const F& if Const is true, F& otherwise.
Let /*maybe-const*/<Const, Views> denote const Views if Const is true, Views otherwise.
Let /*POT*/ denote the pack of types std::iterator_traits<std::iterator_t</*maybe-const*/<Const, Views>>>::iterator_category...
Now the actual members:
iterator_category(optional) β this one has layers, ok? Hold my hand:
If /*Base*/ models forward_range, then iterator_category denotes:
std::input_iterator_tag, ifstd::invoke_result_t</*maybe-const*/<Const, F>&, ranges::range_reference_t</*maybe-const*/<Const, Views>>...>is not a reference.- Otherwise,
std::random_access_iterator_tag, if(std::derived_from</*POT*/, std::random_access_iterator_tag> && ...)istrue.- Otherwise,
std::bidirectional_iterator_tag, if(std::derived_from</*POT*/, std::bidirectional_iterator_tag> && ...)istrue. - Otherwise,
std::forward_iterator_tag, if(std::derived_from</*POT*/, std::forward_iterator_tag> && ...)istrue. - Otherwise,
std::input_iterator_tag.
Heads up: it is not present if/*Base*/does not modelforward_range. Not me showing up with noiterator_category, embarrassing π
iterator_conceptβ/*ziperator*/<Const>::iterator_concept. That's it, that's the definition π«Άvalue_typeβ let/*RREF*/beranges::range_reference_t<Views>..., and/*CRREF*/beranges::range_reference_t<const Views>.... Then:std::remove_cvref_t<std::invoke_result_t<F&, /*RREF*/>>ifConstisfalse,std::remove_cvref_t<std::invoke_result_t<const F&, /*CRREF*/>>otherwise.
difference_typeβrange::range_difference_t</*Base*/>>β well, exactlyrange::range_difference_t</*Base*/>π
π¦ Data members π¦
parent_(private) β a pointerParent*to the parent object. (exposition-only member object*)inner_(private) β an iterator of typeziperator<Const>. (exposition-only member type*)
π Member functions π
- constructor (C++23) β constructs an iterator. (public member function)
operator*(C++23) β obtains the result of applying the invocable object to the underlying pointed-to elements. (public member function)operator[](C++23) β obtains the result of applying the invocable object to the underlying elements at given offset. (public member function)operator++,operator++(int),operator--,operator--(int),operator+=,operator-=(C++23) β advances or decrements the underlying iterator. (public member function)
π₯ Non-member functions π₯
operator==,operator<=>(C++23) β compares the underlying iterators. (function)operator+,operator-(C++23) β performs iterator arithmetic on underlying iterators. (function)
π₯Ί Example π₯Ί
This section is incomplete.
Reason: no example.
Not the "no example" arc π we're all rooting for you, example section. You'll get there.
π Category π
- Todo no example
Lowkey a whole journey, ngl β but you ate that, bestie π This gem came straight from http://cppreference.com, dated 2024.06.10, on the std::ranges...ew::iterator(3) page in the C++ Standard Library manual. Go forth and zip-transform, you main character β¨ππ
π¦ 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