From Jason Turner

[range.cache.latest.view]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjsk6lrjo/{from.md → to.md} +73 -0
tmp/tmpjsk6lrjo/{from.md → to.md} RENAMED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `cache_latest_view` <a id="range.cache.latest.view">[[range.cache.latest.view]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::ranges {
5
+ template<input_range V>
6
+ requires view<V>
7
+ class cache_latest_view : public view_interface<cache_latest_view<V>> {
8
+ V base_ = V(); // exposition only
9
+ using cache-t = conditional_t<is_reference_v<range_reference_t<V>>, // exposition only
10
+ add_pointer_t<range_reference_t<V>>,
11
+ range_reference_t<V>>;
12
+
13
+ non-propagating-cache<cache-t> cache_; // exposition only
14
+
15
+ // [range.cache.latest.iterator], class cache_latest_view::iterator
16
+ class iterator; // exposition only
17
+ // [range.cache.latest.sentinel], class cache_latest_view::sentinel
18
+ class sentinel; // exposition only
19
+
20
+ public:
21
+ cache_latest_view() requires default_initializable<V> = default;
22
+ constexpr explicit cache_latest_view(V base);
23
+
24
+ constexpr V base() const & requires copy_constructible<V> { return base_; }
25
+ constexpr V base() && { return std::move(base_); }
26
+
27
+ constexpr auto begin();
28
+ constexpr auto end();
29
+
30
+ constexpr auto size() requires sized_range<V>;
31
+ constexpr auto size() const requires sized_range<const V>;
32
+
33
+ constexpr auto reserve_hint() requires approximately_sized_range<V>;
34
+ constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
35
+ };
36
+
37
+ template<class R>
38
+ cache_latest_view(R&&) -> cache_latest_view<views::all_t<R>>;
39
+ }
40
+ ```
41
+
42
+ ``` cpp
43
+ constexpr explicit cache_latest_view(V base);
44
+ ```
45
+
46
+ *Effects:* Initializes *base\_* with `std::move(base)`.
47
+
48
+ ``` cpp
49
+ constexpr auto begin();
50
+ ```
51
+
52
+ *Effects:* Equivalent to: `return `*`iterator`*`(*this);`
53
+
54
+ ``` cpp
55
+ constexpr auto end();
56
+ ```
57
+
58
+ *Effects:* Equivalent to: `return `*`sentinel`*`(*this);`
59
+
60
+ ``` cpp
61
+ constexpr auto size() requires sized_range<V>;
62
+ constexpr auto size() const requires sized_range<const V>;
63
+ ```
64
+
65
+ *Effects:* Equivalent to: `return ranges::size(`*`base_`*`);`
66
+
67
+ ``` cpp
68
+ constexpr auto reserve_hint() requires approximately_sized_range<V>;
69
+ constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
70
+ ```
71
+
72
+ *Effects:* Equivalent to: `return ranges::reserve_hint(`*`base_`*`);`
73
+