tmp/tmp45vldi_u/{from.md → to.md}
RENAMED
|
@@ -85,10 +85,26 @@ namespace std::ranges {
|
|
| 85 |
|
| 86 |
constexpr auto size() const requires sized_range<const V> {
|
| 87 |
auto n = ranges::size(base_);
|
| 88 |
return ranges::min(n, static_cast<decltype(n)>(count_));
|
| 89 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
};
|
| 91 |
|
| 92 |
template<class R>
|
| 93 |
take_view(R&&, range_difference_t<R>)
|
| 94 |
-> take_view<views::all_t<R>>;
|
|
|
|
| 85 |
|
| 86 |
constexpr auto size() const requires sized_range<const V> {
|
| 87 |
auto n = ranges::size(base_);
|
| 88 |
return ranges::min(n, static_cast<decltype(n)>(count_));
|
| 89 |
}
|
| 90 |
+
|
| 91 |
+
constexpr auto reserve_hint() {
|
| 92 |
+
if constexpr (approximately_sized_range<V>) {
|
| 93 |
+
auto n = static_cast<range_difference_t<V>>(ranges::reserve_hint(base_));
|
| 94 |
+
return to-unsigned-like(ranges::min(n, count_));
|
| 95 |
+
}
|
| 96 |
+
return to-unsigned-like(count_);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
constexpr auto reserve_hint() const {
|
| 100 |
+
if constexpr (approximately_sized_range<const V>) {
|
| 101 |
+
auto n = static_cast<range_difference_t<const V>>(ranges::reserve_hint(base_));
|
| 102 |
+
return to-unsigned-like(ranges::min(n, count_));
|
| 103 |
+
}
|
| 104 |
+
return to-unsigned-like(count_);
|
| 105 |
+
}
|
| 106 |
};
|
| 107 |
|
| 108 |
template<class R>
|
| 109 |
take_view(R&&, range_difference_t<R>)
|
| 110 |
-> take_view<views::all_t<R>>;
|