tmp/tmpzh51b_oy/{from.md → to.md}
RENAMED
|
@@ -33,10 +33,20 @@ namespace std::ranges {
|
|
| 33 |
const auto s = ranges::size(base_);
|
| 34 |
const auto c = static_cast<decltype(s)>(count_);
|
| 35 |
return s < c ? 0 : s - c;
|
| 36 |
}
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
private:
|
| 39 |
V base_ = V(); // exposition only
|
| 40 |
range_difference_t<V> count_ = 0; // exposition only
|
| 41 |
};
|
| 42 |
|
|
|
|
| 33 |
const auto s = ranges::size(base_);
|
| 34 |
const auto c = static_cast<decltype(s)>(count_);
|
| 35 |
return s < c ? 0 : s - c;
|
| 36 |
}
|
| 37 |
|
| 38 |
+
constexpr auto reserve_hint() requires approximately_sized_range<V> {
|
| 39 |
+
const auto s = static_cast<range_difference_t<V>>(ranges::reserve_hint(base_));
|
| 40 |
+
return to-unsigned-like(s < count_ ? 0 : s - count_);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
constexpr auto reserve_hint() const requires approximately_sized_range<const V> {
|
| 44 |
+
const auto s = static_cast<range_difference_t<const V>>(ranges::reserve_hint(base_));
|
| 45 |
+
return to-unsigned-like(s < count_ ? 0 : s - count_);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
private:
|
| 49 |
V base_ = V(); // exposition only
|
| 50 |
range_difference_t<V> count_ = 0; // exposition only
|
| 51 |
};
|
| 52 |
|