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

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

πŸ’– NAME πŸ’–

std::ranges::cartesian_product_view::iterator β€” std::ranges::cartesian_product_view::iterator (yes, the page really names it twice, bestie). This is from the C++ Standard Libary manual, and it’s giving main-character iterator energy fr fr. πŸ’…


✨ SYNOPSIS ✨

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

Okay so this is the return type of cartesian_product_view::begin, and of cartesian_product_view::end when the underlying view V is a common_range.

The type /*iterator*/<true> is returned by the const-qualified overloads. The type /*iterator*/<false> is returned by the non-const-qualified overloads. No cap. 🫢


🧸 MEMBER TYPES 🧸

  • iterator_category β€” std::input_iterator_tag
  • iterator_concept β€” it’s a whole vibe check:
    • std::random_access_iterator_tag, if /*cartesian-product-is-random-access*/<Const, First, Vs...> is modeled,
    • std::bidirectional_iterator_tag, if /*cartesian-product-is-bidirectional*/<Const, First, Vs...> is modeled,
    • std::forward_iterator_tag, if /*maybe-const*/<Const, First> models forward_range,
    • std::input_iterator_tag otherwise.
  • value_type β€” std::tuple<ranges::range_value_t</*maybe-const*/<Const, First>>, ranges::range_value_t</*maybe-const*/<Const, Vs>>...>;
  • reference β€” std::tuple<ranges::range_reference_t</*maybe-const*/<Const, First>>, ranges::range_reference_t</*maybe-const*/<Const, Vs>>...>;
  • difference_type β€” an implementation-defined signed-integer-like type (maybe the smallest of such types), which is sufficiently wide to store the product of the maximum sizes of all underlying ranges, if such type exists.
  • Parent (private) β€” /*maybe-const*/<Const, cartesian_product_view>. (exposition-only member type*)

πŸ‘œ DATA MEMBERS πŸ‘œ

  • parent_ (private) β€” a pointer of type Parent to the parent cartesian_product_view. (exposition-only member object*)
  • current_ (private) β€” a tuple of iterators to the current underlying elements of type
std::tuple<ranges::iterator_t</*maybe-const*/<Const, First>>,
           ranges::iterator_t</*maybe-const*/<Const, Vs>>...>

(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) β€” advances or decrements the underlying iterator (public member function)
  • operator+=, operator-= (C++23) β€” the page lists these with (C++23) and gives no extra description.
  • next (C++23) β€” advances the iterator (exposition-only member function*)
  • prev (C++23) β€” decrements the iterator (exposition-only member function*)
  • distance_from (C++23) β€” returns the distance between two iterators (exposition-only member function*)

🌈 NON-MEMBER FUNCTIONS 🌈

  • operator==, 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 underlying pointed-to elements (function)

😭 EXAMPLE 😭

This section is incomplete.

Reason: no example. πŸ’€


πŸ“š REFERENCES πŸ“š

  • C++23 standard (ISO/IEC 14882:2023):
  • 26.7.32.3 Class template cartesian_product_view::iterator [range.cartesian.iterator]

πŸ‘€ SEE ALSO πŸ‘€

Category:

  • Todo no example

πŸ’… that’s the whole page, bestie. Source/version: http://cppreference.com, 2024.06.10, page std::ranges...ew::iterator(3). 🫢✨

πŸ“¦ where this page comes from