cpp/ranges/cartesian product view/iterator/helpers

{{member|{{small|std::ranges::cartesian_product_view::iterator::}}distance_from|2= {{ddcl|since=c++23|1= template< class Tuple > constexpr difference_type /*distance-from*/( const Tuple& t ) const;     // exposition only }}

Returns the "distance" (i.e., number of "hops") between two {{rlp|/|iterators}}.

Let:
 * {{rlpt|/#Data members|parent_}} be the underlying pointer to {{tt|cartesian_product_view}}
 * {{c|/*scaled-size*/(N)}} be:
 * the product of {{c|static_cast(ranges::size(std::get(parent_->bases_)))}} and {{c|/*scaled-size*/(N + 1)}} if {{c|N ≤ sizeof...(Vs)}}, otherwise
 * {{c|static_cast(1);}}
 * {{c|/*scaled-distance*/(N)}} be the product of {{c|static_cast(std::get(current_) - std::get(t))}} and {{c|/*scaled-size*/(N + 1);}}
 * {{c|/*scaled-sum*/}} be the sum of {{c|/*scaled-distance*/(N)}} for every integer {{c|0 ≤ N ≤ sizeof...(Vs)}}.

Returns: {{c|/*scaled-sum*/}}.

The behavior is undefined if {{c|/*scaled-sum*/}} cannot be represented by {{tt|difference_type}}.

Used in the following functions:
 * {{rlpt|operator_arith2|operator-}}{{c/core|(const /*iterator*/&, const /*iterator*/&)}}
 * {{rlpt|operator_arith2|operator-}}{{c/core|(const /*iterator*/&, std::default_sentinel_t)}}

Parameters
}}