[range.zip.sentinel] # 25 Ranges library [[ranges]](./#ranges) ## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.zip.sentinel) ### 25.7.25 Zip view [[range.zip]](range.zip#sentinel) #### 25.7.25.4 Class template zip_view​::​*sentinel* [range.zip.sentinel] [🔗](#lib:zip_view::sentinel) namespace std::ranges {template<[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]")... Views>requires ([view](range.view#concept:view "25.4.5 Views [range.view]") && ...) && (sizeof...(Views) > 0)templateclass zip_view::*sentinel* { tuple>...> *end_*; // *exposition only*constexpr explicit *sentinel*(tuple>...> end); // *exposition only*public:*sentinel*() = default; constexpr *sentinel*(*sentinel* i)requires Const && ([convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]"), sentinel_t> && ...); templaterequires ([sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")>, iterator_t<*maybe-const*>> && ...)friend constexpr bool operator==(const *iterator*& x, const *sentinel*& y); templaterequires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")>, iterator_t<*maybe-const*>> && ...)friend constexpr common_type_t>...>operator-(const *iterator*& x, const *sentinel*& y); templaterequires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")>, iterator_t<*maybe-const*>> && ...)friend constexpr common_type_t>...>operator-(const *sentinel*& y, const *iterator*& x); };} [🔗](#lib:zip_view::sentinel,constructor) `constexpr explicit sentinel(tuple>...> end); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11910) *Effects*: Initializes *end_* with end[.](#1.sentence-1) [🔗](#lib:zip_view::sentinel,constructor_) `constexpr sentinel(sentinel i) requires Const && ([convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]"), sentinel_t> && ...); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11922) *Effects*: Initializes *end_* with std​::​move(i.*end_*)[.](#2.sentence-1) [🔗](#lib:operator==,zip_view::sentinel) `template requires ([sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")>, iterator_t>> && ...) friend constexpr bool operator==(const iterator& x, const sentinel& y); ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11936) *Returns*: true if there exists an integer 0≤i(x.​*current_*) == std​::​get(y.*end_*)) is true[.](#3.sentence-1) Otherwise, false[.](#3.sentence-2) [🔗](#lib:operator-,zip_view::sentinel) `template requires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")>, iterator_t>> && ...) friend constexpr common_type_t>...> operator-(const iterator& x, const sentinel& y); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11954) Let D be the return type[.](#4.sentence-1) Let *DIST*(i) beD(std​::​get(x.*current_*) - std​::​get(y.*end_*))[.](#4.sentence-2) [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11959) *Returns*: The value with the smallest absolute value among *DIST*(n) for all integers 0≤n requires ([sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")>, iterator_t>> && ...) friend constexpr common_type_t>...> operator-(const sentinel& y, const iterator& x); ` [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L11975) *Effects*: Equivalent to: return -(x - y);