5.4 KiB
[range.zip.sentinel]
25 Ranges library [ranges]
25.7 Range adaptors [range.adaptors]
25.7.25 Zip view [range.zip]
25.7.25.4 Class template zip_view::sentinel [range.zip.sentinel]
namespace std::ranges {template<input_range... Views>requires (view && ...) && (sizeof...(Views) > 0)templateclass zip_view<Views...>::sentinel { tuple<sentinel_t<maybe-const<Const, Views>>...> end_; // exposition onlyconstexpr explicit sentinel(tuple<sentinel_t<maybe-const<Const, Views>>...> end); // exposition onlypublic:sentinel() = default; constexpr sentinel(sentinel i)requires Const && (convertible_to<sentinel_t, sentinel_t> && ...); templaterequires (sentinel_for<sentinel_t<maybe-const<Const, Views>>, iterator_t<maybe-const<OtherConst, Views>>> && ...)friend constexpr bool operator==(const iterator& x, const sentinel& y); templaterequires (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& x, const sentinel& y); templaterequires (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& 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](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_to [concept.convertible]")<sentinel_t<Views>, sentinel_t<const Views>> && ...);
Effects: Initializes end_ with std::move(i.end_).
template<bool OtherConst> requires ([sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]")<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 0â¤i<sizeof...(Views) such that bool(std::get(x.current_) == std::get(y.end_)) is true.
Otherwise, false.
template<bool OtherConst> requires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<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) beD(std::get(x.current_) - std::get(y.end_)).
Returns: The value with the smallest absolute value among DIST(n) for all integers 0â¤n<sizeof...(Views).
template<bool OtherConst> requires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_sentinel_for [iterator.concept.sizedsentinel]")<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);