From Jason Turner

[range.transform.sentinel]

Diff to HTML by rtfpessoa

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