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

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

πŸ’– NAME πŸ’–

okay so bestie, welcome to the std::ranges...ew::iterator(3) page from the C++ Standard Libary (that spelling is canon, don't come for me πŸ’€). The actual name is std::ranges::slide_view::iterator β€” and the page literally says std::ranges::slide_view::iterator - std::ranges::slide_view::iterator, which is highkey iconic of it.


πŸ¦‹ Synopsis πŸ¦‹

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

This is the return type of slide_view::begin, and of slide_view::end when the underlying view V is a common_range. no cap, that's the whole vibe.

The type /*iterator*/<true> is returned by the const-qualified overloads. The type /*iterator*/<false> is returned by the non-const-qualified overloads. slay, const correctness πŸ’….


πŸŽ€ Member types πŸŽ€

here's the member-type tea, bestie β˜•:

  • Base (private) β€” const V if Const is true, otherwise V. (exposition-only member type*)
  • iterator_category β€” std::input_iterator_tag.
  • iterator_concept β€”
    • std::random_access_iterator_tag, if Base models random_access_range. Otherwise,
    • std::bidirectional_iterator_tag, if Base models bidirectional_range. Otherwise,
    • std::forward_iterator_tag.
  • value_type β€” decltype(views::counted(current_, n_)).
  • difference_type β€” ranges::range_difference_t<Base>.

🧺 Data members 🧺

these are the private little data gremlins, and yes they're exposition-only πŸ‘€:

  • current_ (private) β€” ranges::iterator_t<Base>, holds an iterator to the first underlying element of the current window in slide_view (exposition-only member object*).
  • last_ele_ (private) (optional) β€” ranges::iterator_t<Base>, holds an iterator to the one-past-end underlying element of the current window in slide_view. Present only if Base models /*slide-caches-first*/. (exposition-only member object*)
  • n_ (private) β€” ranges::range_difference_t<Base>, holds the window width of slide_view. (exposition-only member object*)

✨ Member functions ✨

  • constructor β€” constructs an iterator (C++23, public member function).
  • operator* β€” accesses the element (C++23, public member function).
  • operator[] β€” accesses an element by index (C++23, public member function).
  • operator++, operator++(int), operator--, operator--(int), operator+=, operator-= β€” advances or decrements the underlying iterators (C++23, public member function).

🌈 Non-member functions 🌈

  • operator==, operator<, operator>, operator<=, operator>=, operator<=> β€” compares the underlying iterators (C++23, function).
  • operator+, operator- β€” performs iterator arithmetic (C++23, function).

πŸ“ Example πŸ“

This section is incomplete Reason: no example.

not me leaving this section empty, but that's literally what the page says 😭.


πŸ“š References πŸ“š

  • C++23 standard (ISO/IEC 14882:2023):
    • 26.7.29.3 Class template slide_view::iterator [range.slide.iterator]

πŸ‘€ See also πŸ‘€

Category: * Todo no example


made with πŸ’– from http://cppreference.com, dated 2024.06.10, page std::ranges...ew::iterator(3) β€” bye bestie, go iterate responsibly 🫢✨

πŸ“¦ where this page comes from