friend constexpr /*iterator*/ operator+( const /*iterator*/& i, difference_type n ) requires /*cartesian-product-is-random-access*/<Const, First, Vs...>; | (1) | (since C++23) |
friend constexpr /*iterator*/ operator+( difference_type n, const /*iterator*/& i ) requires /*cartesian-product-is-random-access*/<Const, First, Vs...>; | (2) | (since C++23) |
friend constexpr /*iterator*/ operator-( const /*iterator*/& i, difference_type n ) requires /*cartesian-product-is-random-access*/<Const, First, Vs...>; | (3) | (since C++23) |
friend constexpr difference_type operator-( const /*iterator*/& i, const /*iterator*/& j ) requires /*cartesian-is-sized-sentinel*/<Const, iterator_t, First, Vs...>; | (4) | (since C++23) |
friend constexpr difference_type operator-( const /*iterator*/& i, std::default_sentinel_t ) requires /*cartesian-is-sized-sentinel*/<Const, ranges::sentinel_t, First, Vs...>; | (5) | (since C++23) |
friend constexpr difference_type operator-( std::default_sentinel_t s, const /*iterator*/& i ) requires /*cartesian-is-sized-sentinel*/<Const, ranges::sentinel_t, First, Vs...>; | (6) | (since C++23) |
Performs iterator arithmetic or calculates the distance.
Let current_
denote the underlying tuple of iterators and parent_
denote the underlying pointer to cartesian_product_view
.
return /*iterator*/(i) += n;
.return i + n;
.return /*iterator*/(i) -= n;
.return i.distance_from(j.current_);
./*end-tuple*/
be an object of a type that is a specialization of tuple
, such that: std::get<0>(/*end-tuple*/)
has the same value as ranges::end(std::get<0>(i.parent_->bases_));
std::get<N>(/*end-tuple*/)
has the same value as ranges::begin(std::get<N>(i.parent_->bases_))
for every integer 1 ≤ N ≤ sizeof...(Vs)
. return i.distance_from(/*end-tuple*/);
. return -(i - s);
.These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when cartesian_product_view::iterator<Const>
is an associated class of the arguments.
i, j | - | the iterators |
n | - | the position relative to current location |
s | - | the sentinel |
(C++23) | advances or decrements the underlying iterator (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/cartesian_product_view/iterator/operator_arith2