tmp/tmpyw2nvzni/{from.md → to.md}
RENAMED
|
@@ -140,10 +140,26 @@ namespace std::ranges {
|
|
| 140 |
|
| 141 |
constexpr auto size() const requires sized_range<const V> {
|
| 142 |
auto n = ranges::size(base_);
|
| 143 |
return ranges::min(n, static_cast<decltype(n)>(count_));
|
| 144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
};
|
| 146 |
|
| 147 |
template<class R>
|
| 148 |
take_view(R&&, range_difference_t<R>)
|
| 149 |
-> take_view<views::all_t<R>>;
|
|
|
|
| 140 |
|
| 141 |
constexpr auto size() const requires sized_range<const V> {
|
| 142 |
auto n = ranges::size(base_);
|
| 143 |
return ranges::min(n, static_cast<decltype(n)>(count_));
|
| 144 |
}
|
| 145 |
+
|
| 146 |
+
constexpr auto reserve_hint() {
|
| 147 |
+
if constexpr (approximately_sized_range<V>) {
|
| 148 |
+
auto n = static_cast<range_difference_t<V>>(ranges::reserve_hint(base_));
|
| 149 |
+
return to-unsigned-like(ranges::min(n, count_));
|
| 150 |
+
}
|
| 151 |
+
return to-unsigned-like(count_);
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
constexpr auto reserve_hint() const {
|
| 155 |
+
if constexpr (approximately_sized_range<const V>) {
|
| 156 |
+
auto n = static_cast<range_difference_t<const V>>(ranges::reserve_hint(base_));
|
| 157 |
+
return to-unsigned-like(ranges::min(n, count_));
|
| 158 |
+
}
|
| 159 |
+
return to-unsigned-like(count_);
|
| 160 |
+
}
|
| 161 |
};
|
| 162 |
|
| 163 |
template<class R>
|
| 164 |
take_view(R&&, range_difference_t<R>)
|
| 165 |
-> take_view<views::all_t<R>>;
|