26 Ranges library [ranges]

26.7 Range adaptors [range.adaptors]

26.7.24 Zip view [range.zip]

26.7.24.4 Class template zip_view​::​sentinel [range.zip.sentinel]

namespace std::ranges { template<input_range... Views> requires (view<Views> && ...) && (sizeof...(Views) > 0) template<bool Const> class zip_view<Views...>::sentinel { tuple<sentinel_t<maybe-const<Const, Views>>...> end_; // exposition only constexpr explicit sentinel(tuple<sentinel_t<maybe-const<Const, Views>>...> end); // exposition only public: sentinel() = default; constexpr sentinel(sentinel<!Const> i) requires Const && (convertible_to<sentinel_t<Views>, sentinel_t<const Views>> && ...); template<bool OtherConst> requires (sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y); template<bool OtherConst> requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...> operator-(const iterator<OtherConst>& x, const sentinel& y); template<bool OtherConst> requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...> operator-(const sentinel& y, const iterator<OtherConst>& x); }; }
constexpr explicit sentinel(tuple<sentinel_t<maybe-const<Const, Views>>...> end);
Effects: Initializes end_ with end.
constexpr sentinel(sentinel<!Const> i) requires Const && (convertible_to<sentinel_t<Views>, sentinel_t<const Views>> && ...);
Effects: Initializes end_ with std​::​move(i.end_).
template<bool OtherConst> requires (sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
Returns: true if there exists an integer such that bool(std​::​get<i>(x.current_) == std​::​get<i>(y.end_)) is true.
Otherwise, false.
template<bool OtherConst> requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...> operator-(const iterator<OtherConst>& x, const sentinel& y);
Let D be the return type.
Let DIST(i) be D(std​::​get<i>(x.current_) - std​::​get<i>(y.end_)).
Returns: The value with the smallest absolute value among DIST(n) for all integers .
template<bool OtherConst> requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...) friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...> operator-(const sentinel& y, const iterator<OtherConst>& x);
Effects: Equivalent to return -(x - y);