std::ranges...w::iterator(3)
π std::ranges::join_view::iterator π
okay bestie, welcome to the <std::ranges...w::iterator(3)> page from the C++ Standard Libary manual. this is the iterator type for join_view, and it's literally giving "nested ranges but make it iterable" energy. let's get into it π«Ά
β¨ NAME β¨
std::ranges::join_view::iterator β std::ranges::join_view::iterator. that's the name, that's the vibe, no notes π
πΈ Synopsis πΈ
template< bool Const > (since C++20)
class /*iterator*/ (exposition only*)
The return type of join_view::begin, and of join_view::end when both the outer range V and the inner range ranges::range_reference_t<V> satisfy common_range and the parent join_view is a forward_range.
If V is not a simple view (e.g. if ranges::iterator_t<const V> is invalid or different from ranges::iterator_t<V>), Const is true for iterators returned from the const overloads, and false otherwise. If V is a simple view, Const is true if and only if ranges::range_reference_t<V> is a reference.
π Member types π
Parentβconst join_view<V>ifConstistrue, otherwisejoin_view<V>(exposition-only member type*)Baseβconst VifConstistrue, otherwiseV(exposition-only member type*)OuterIterβranges::iterator_t<Base>(exposition-only member type*)InnerIterβranges::iterator_t<ranges::range_reference_t<Base>>(exposition-only member type*)iterator_conceptβ it's this whole situation:std::bidirectional_iterator_tag, ifranges::range_reference_t<Base>is a reference type, andBaseandranges::range_reference_t<Base>each modelbidirectional_range;std::forward_iterator_tag, ifranges::range_reference_t<Base>is a reference type, andBaseandranges::range_reference_t<Base>each modelforward_range;std::input_iterator_tagotherwise.
iterator_categoryβ defined only ifiterator::iterator_concept(see above) denotesstd::forward_iterator_tag. LetOUTERCbestd::iterator_traits<ranges::iterator_t<Base>>::iterator_category, and letINNERCbestd::iterator_traits<ranges::iterator_t<ranges::range_reference_t<Base>>>::iterator_category. then:std::bidirectional_iterator_tag, ifOUTERCandINNERCeach modelstd::derived_from<std::bidirectional_iterator_tag>;std::forward_iterator_tag, ifOUTERCandINNERCeach modelstd::derived_from<std::forward_iterator_tag>;std::input_iterator_tagotherwise.
value_typeβranges::range_value_t<ranges::range_reference_t<Base>>difference_typeβstd::common_type_t<ranges::range_difference_t<Base>, ranges::range_difference_t<ranges::range_reference_t<Base>>>
π¦ Member objects π¦
outer_(private) β an object of typeOuterIter(exposition-only member object*)inner_(private) β an object of typeInnerIter(exposition-only member object*)parent_(private) β an object of typeParent(exposition-only member object*)
π Member functions π
constructor(C++20) β constructs an iterator (public member function)operator*(C++20) andoperator->(C++20) β accesses the element (public member function)operator++(C++20),operator++(int)(C++20),operator--(C++20), andoperator--(int)(C++20) β advances or decrements the underlying iterators (public member function)satisfy(C++20) β skips over empty inner ranges (exposition-only member function*)
π Non-member functions π
operator==(C++20) β compares the underlying iterators (function)iter_move(C++20) β casts the result of dereferencing the underlying iterator to its associated rvalue reference type (function)iter_swap(C++20) β swaps the objects pointed to by two underlying iterators (function)
that's the whole page, bestie π source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::ranges...w::iterator(3). go be the main character of your range adaptors πβ¨
π¦ 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