tmp/tmppaqr7pba/{from.md → to.md}
RENAMED
|
@@ -65,10 +65,13 @@ namespace std::ranges {
|
|
| 65 |
requires (!(simple-view<V> && slide-caches-nothing<const V>));
|
| 66 |
constexpr auto end() const requires slide-caches-nothing<const V>;
|
| 67 |
|
| 68 |
constexpr auto size() requires sized_range<V>;
|
| 69 |
constexpr auto size() const requires sized_range<const V>;
|
|
|
|
|
|
|
|
|
|
| 70 |
};
|
| 71 |
|
| 72 |
template<class R>
|
| 73 |
slide_view(R&&, range_difference_t<R>) -> slide_view<views::all_t<R>>;
|
| 74 |
}
|
|
@@ -152,10 +155,24 @@ constexpr auto size() const requires sized_range<const V>;
|
|
| 152 |
auto sz = ranges::distance(base_) - n_ + 1;
|
| 153 |
if (sz < 0) sz = 0;
|
| 154 |
return to-unsigned-like(sz);
|
| 155 |
```
|
| 156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
#### Class template `slide_view::iterator` <a id="range.slide.iterator">[[range.slide.iterator]]</a>
|
| 158 |
|
| 159 |
``` cpp
|
| 160 |
namespace std::ranges {
|
| 161 |
template<forward_range V>
|
|
|
|
| 65 |
requires (!(simple-view<V> && slide-caches-nothing<const V>));
|
| 66 |
constexpr auto end() const requires slide-caches-nothing<const V>;
|
| 67 |
|
| 68 |
constexpr auto size() requires sized_range<V>;
|
| 69 |
constexpr auto size() const requires sized_range<const V>;
|
| 70 |
+
|
| 71 |
+
constexpr auto reserve_hint() requires approximately_sized_range<V>;
|
| 72 |
+
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
|
| 73 |
};
|
| 74 |
|
| 75 |
template<class R>
|
| 76 |
slide_view(R&&, range_difference_t<R>) -> slide_view<views::all_t<R>>;
|
| 77 |
}
|
|
|
|
| 155 |
auto sz = ranges::distance(base_) - n_ + 1;
|
| 156 |
if (sz < 0) sz = 0;
|
| 157 |
return to-unsigned-like(sz);
|
| 158 |
```
|
| 159 |
|
| 160 |
+
``` cpp
|
| 161 |
+
constexpr auto reserve_hint() requires approximately_sized_range<V>;
|
| 162 |
+
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
*Effects:* Equivalent to:
|
| 166 |
+
|
| 167 |
+
``` cpp
|
| 168 |
+
auto sz = static_cast<range_difference_t<decltype((base_))>>(ranges::reserve_hint(base_)) -
|
| 169 |
+
n_ + 1;
|
| 170 |
+
if (sz < 0) sz = 0;
|
| 171 |
+
return to-unsigned-like(sz);
|
| 172 |
+
```
|
| 173 |
+
|
| 174 |
#### Class template `slide_view::iterator` <a id="range.slide.iterator">[[range.slide.iterator]]</a>
|
| 175 |
|
| 176 |
``` cpp
|
| 177 |
namespace std::ranges {
|
| 178 |
template<forward_range V>
|