Files
2025-10-25 03:02:53 +03:00

73 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[range.slide.sentinel]
# 25 Ranges library [[ranges]](./#ranges)
## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.slide.sentinel)
### 25.7.30 Slide view [[range.slide]](range.slide#sentinel)
#### 25.7.30.4 Class slide_view::*sentinel* [range.slide.sentinel]
[🔗](#lib:slide_view::sentinel)
namespace std::ranges {template<[forward_range](range.refinements#concept:forward_range "25.4.6Other range refinements[range.refinements]") V>requires [view](range.view#concept:view "25.4.5Views[range.view]")<V>class slide_view<V>::*sentinel* { sentinel_t<V> *end_* = sentinel_t<V>(); // *exposition only*constexpr explicit *sentinel*(sentinel_t<V> end); // *exposition only*public:*sentinel*() = default; friend constexpr bool operator==(const *iterator*<false>& x, const *sentinel*& y); friend constexpr range_difference_t<V>operator-(const *iterator*<false>& x, const *sentinel*& y)requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>; friend constexpr range_difference_t<V>operator-(const *sentinel*& y, const *iterator*<false>& x)requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>; };}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L15524)
[*Note [1](#note-1)*:
*sentinel* is used
only when [*slide-caches-first*](range.slide.view#concept:slide-caches-first "25.7.30.2Class template slide_­view[range.slide.view]")<V> is true[.](#1.sentence-1)
— *end note*]
[🔗](#lib:slide_view::sentinel,constructor)
`constexpr explicit sentinel(sentinel_t<V> end);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L15536)
*Effects*: Initializes *end_* with end[.](#2.sentence-1)
[🔗](#lib:operator==,slide_view::sentinel)
`friend constexpr bool operator==(const iterator<false>& x, const sentinel& y);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L15547)
*Returns*: x.*last_ele_* == y.*end_*[.](#3.sentence-1)
[🔗](#lib:operator-,slide_view::sentinel)
`friend constexpr range_difference_t<V>
operator-(const iterator<false>& x, const sentinel& y)
requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>;
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L15560)
*Returns*: x.*last_ele_* - y.*end_*[.](#4.sentence-1)
[🔗](#lib:operator-,slide_view::sentinel_)
`friend constexpr range_difference_t<V>
operator-(const sentinel& y, const iterator<false>& x)
requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L15573)
*Returns*: y.*end_* - x.*last_ele_*[.](#5.sentence-1)