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

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

🌸 NAME

okay bestie, welcome to the std::ranges::chunk_view::iterator page from the C++ Standard Libary manual πŸ’–. The name is std::ranges::chunk_view::iterator, and the name line is also std::ranges::chunk_view::iterator β€” yes, it’s giving β€œsame name, no notes” energy.


✨ Synopsis

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

This /*iterator*/ is the return type of chunk_view::begin, and of chunk_view::end when the underlying view V is a common_range.

It’s present only if V models forward_range.

The type /*iterator*/<true> is returned by the const-qualified overloads. The type /*iterator*/<false> is returned by the non-const-qualified overloads. const girlies stay winning πŸ’…


πŸŽ€ Member types

  • Parent (private) β€” const chunk_view if Const is true, otherwise chunk_view. (exposition-only member type*)
  • Base (private) β€” const V if Const is true, otherwise V. (exposition-only member type*)
  • iterator_category β€” std::input_iterator_tag
  • iterator_concept β€” the vibe check is:
    • 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::take(ranges::subrange(current_, end_), n_));
  • difference_type β€” ranges::range_difference_t<Base>

πŸ¦‹ Data members

  • current_ (private) β€” ranges::iterator_t<Base>, holds an iterator to the first element of current chunk in the underlying sequence (i.e. the begin of a chunk). (exposition-only member object*)
  • end_ (private) β€” ranges::sentinel_t<Base>, holds a sentinel to the end of the underlying sequence. (exposition-only member object*)
  • n_ (private) β€” ranges::range_difference_t<Base>, holds initial number of elements in the chunk (the last chunk can be smaller). (exposition-only member object*)
  • missing_ (private) β€” ranges::range_difference_t<Base>, usually equals to ranges::advance(current_, n_, end_);. (exposition-only member object*)

πŸ’… Member functions

  • constructor (C++23) β€” constructs an iterator (public member function)
  • base (C++23) β€” returns an iterator to current element (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-= (C++23) β€” advances or decrements the underlying iterator (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 (function)

🌈 Example

This section is incomplete.

Reason: no example

not me showing up with no example 😭 no cap, that’s literally what it says.


⭐ References

  • C++23 standard (ISO/IEC 14882:2023):
  • 26.7.28.7 Class template chunk_view::iterator for forward ranges [range.chunk.fwd.iter]

πŸ‘‘ See also

Category:

  • Todo no example

πŸ’– okay that’s the whole page, bestie! source/version: http://cppreference.com β€” date: 2024.06.10 β€” page: std::ranges...ew::iterator(3). periodt ✨

πŸ“¦ where this page comes from