From Jason Turner

[range.take.while.sentinel]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjzepdcbi/{from.md → to.md} +47 -0
tmp/tmpjzepdcbi/{from.md → to.md} RENAMED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `take_while_view::sentinel` <a id="range.take.while.sentinel">[[range.take.while.sentinel]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::ranges {
5
+ template<view V, class Pred>
6
+ requires input_range<V> && is_object_v<Pred> &&
7
+ indirect_unary_predicate<const Pred, iterator_t<V>>
8
+ template<bool Const>
9
+ class take_while_view<V, Pred>::sentinel { // exposition only
10
+ using Base = conditional_t<Const, const V, V>; // exposition only
11
+
12
+ sentinel_t<Base> end_ = sentinel_t<Base>(); // exposition only
13
+ const Pred* pred_ = nullptr; // exposition only
14
+ public:
15
+ sentinel() = default;
16
+ constexpr explicit sentinel(sentinel_t<Base> end, const Pred* pred);
17
+ constexpr sentinel(sentinel<!Const> s)
18
+ requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
19
+
20
+ constexpr sentinel_t<Base> base() const { return end_; }
21
+
22
+ friend constexpr bool operator==(const iterator_t<Base>& x, const sentinel& y);
23
+ };
24
+ }
25
+ ```
26
+
27
+ ``` cpp
28
+ constexpr explicit sentinel(sentinel_t<Base> end, const Pred* pred);
29
+ ```
30
+
31
+ *Effects:* Initializes *end\_* with `end` and *pred\_* with `pred`.
32
+
33
+ ``` cpp
34
+ constexpr sentinel(sentinel<!Const> s)
35
+ requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
36
+ ```
37
+
38
+ *Effects:* Initializes *end\_* with `s.`*`end_`* and *pred\_* with
39
+ `s.`*`pred_`*.
40
+
41
+ ``` cpp
42
+ friend constexpr bool operator==(const iterator_t<Base>& x, const sentinel& y);
43
+ ```
44
+
45
+ *Effects:* Equivalent to:
46
+ `return y.`*`end_`*` == x || !invoke(*y.`*`pred_`*`, *x);`
47
+