std::ranges...w::iterator(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

std::ranges::adjacent_view::iterator β€” std::ranges::adjacent_view::iterator. Yep bestie, the NAME section says it twice and we're keeping both, no erasure πŸ’…. This page is std::ranges...w::iterator(3) from the C++ Standard Libary (that's the manual name, typo and all, and I said what I said).

✨ Synopsis ✨

template< bool Const >  (since C++23)
class /*iterator*/      (exposition only*)

Okay so this is the return type of adjacent_view::begin, and also of adjacent_view::end when the underlying view V is a common_range. Main character behavior fr fr.

The type /*iterator*/<true> is returned by the const-qualified overloads. The type /*iterator*/<false> is returned by the non-const-qualified overloads. Both versions are valid and iconic 🫢.

πŸŽ€ Member types πŸŽ€

Here's the whole member-type lineup, no skipping:

  • Base (private) β€” const V if Const is true, otherwise V. (exposition-only member type*)
  • iterator_category β€” std::input_iterator_tag
    • std::random_access_iterator_tag, if Base models random_access_range. Otherwise,
  • iterator_concept β€” std::bidirectional_iterator_tag, if Base models bidirectional_range. Otherwise,
    • std::forward_iterator_tag.
  • value_type β€” std::tuple</*REPEAT*/(ranges::range_value_t<Base>, N)...>;
  • difference_type β€” ranges::range_difference_t<Base>

πŸ’… Data members πŸ’…

  • current_ (private) β€” std::array<ranges::iterator_t<Base>, N>. (exposition-only member object*)

🌈 Member functions 🌈

  • constructor (C++23) β€” constructs an iterator (public member function)
  • operator* (C++23) β€” accesses the element (public member function)
  • operator[] (C++23) β€” accesses an element by index (public member function)
  • operator++, operator++(int), operator--, operator--(int), operator+=, operator-= β€” advances or decrements the underlying iterators (public member function). The original drops a (C++23) marker right after operator-=, so that's here too 🫑.

πŸ”₯ Non-member functions πŸ”₯

  • operator==, operator<, operator>, operator<=, operator>= β€” compares the underlying iterators (function)
  • operator<=> (C++23) β€” compares the underlying iterators (function)
  • operator+, operator- (C++23) β€” performs iterator arithmetic (function)
  • iter_move (C++23) β€” casts the result of dereferencing the underlying iterator to its associated rvalue reference type (function)
  • iter_swap (C++23) β€” swaps the objects pointed to by two underlying iterators (function)

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example 😭

πŸ‘‘ References πŸ‘‘

  • C++23 standard (ISO/IEC 14882:2023):
  • 26.7.25.3 Class template adjacent_view::iterator [range.adjacent.iterator]

🌸 See also 🌸

Category:

  • Todo no example

And that's the whole page, bestie! Footer source/version and date: http://cppreference.com Β· 2024.06.10 Β· std::ranges...w::iterator(3). Mwah πŸ’–

πŸ“¦ where this page comes from