From Jason Turner

[range.enumerate.sentinel]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptj42ampt/{from.md → to.md} +81 -0
tmp/tmptj42ampt/{from.md → to.md} RENAMED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `enumerate_view::sentinel` <a id="range.enumerate.sentinel">[[range.enumerate.sentinel]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::ranges {
5
+ template<view V>
6
+ requires range-with-movable-references<V>
7
+ template<bool Const>
8
+ class enumerate_view<V>::sentinel {
9
+ using Base = maybe-const<Const, V>; // exposition only
10
+ sentinel_t<Base> end_ = sentinel_t<Base>(); // exposition only
11
+ constexpr explicit sentinel(sentinel_t<Base> end); // exposition only
12
+
13
+ public:
14
+ sentinel() = default;
15
+ constexpr sentinel(sentinel<!Const> other)
16
+ requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
17
+
18
+ constexpr sentinel_t<Base> base() const;
19
+
20
+ template<bool OtherConst>
21
+ requires sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
22
+ friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
23
+
24
+ template<bool OtherConst>
25
+ requires sized_sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
26
+ friend constexpr range_difference_t<maybe-const<OtherConst, V>>
27
+ operator-(const iterator<OtherConst>& x, const sentinel& y);
28
+
29
+ template<bool OtherConst>
30
+ requires sized_sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
31
+ friend constexpr range_difference_t<maybe-const<OtherConst, V>>
32
+ operator-(const sentinel& x, const iterator<OtherConst>& y);
33
+ };
34
+ }
35
+ ```
36
+
37
+ ``` cpp
38
+ constexpr explicit sentinel(sentinel_t<Base> end);
39
+ ```
40
+
41
+ *Effects:* Initializes *end\_* with `std::move(end)`.
42
+
43
+ ``` cpp
44
+ constexpr sentinel(sentinel<!Const> other)
45
+ requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
46
+ ```
47
+
48
+ *Effects:* Initializes *end\_* with `std::move(other.`*`end_`*`)`.
49
+
50
+ ``` cpp
51
+ constexpr sentinel_t<Base> base() const;
52
+ ```
53
+
54
+ *Effects:* Equivalent to: `return `*`end_`*`;`
55
+
56
+ ``` cpp
57
+ template<bool OtherConst>
58
+ requires sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
59
+ friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
60
+ ```
61
+
62
+ *Effects:* Equivalent to: `return x.`*`current_`*` == y.`*`end_`*`;`
63
+
64
+ ``` cpp
65
+ template<bool OtherConst>
66
+ requires sized_sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
67
+ friend constexpr range_difference_t<maybe-const<OtherConst, V>>
68
+ operator-(const iterator<OtherConst>& x, const sentinel& y);
69
+ ```
70
+
71
+ *Effects:* Equivalent to: `return x.`*`current_`*` - y.`*`end_`*`;`
72
+
73
+ ``` cpp
74
+ template<bool OtherConst>
75
+ requires sized_sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>
76
+ friend constexpr range_difference_t<maybe-const<OtherConst, V>>
77
+ operator-(const sentinel& x, const iterator<OtherConst>& y);
78
+ ```
79
+
80
+ *Effects:* Equivalent to: `return x.`*`end_`*` - y.`*`current_`*`;`
81
+