[libcxx-commits] [libcxx] [libc++] Partially implement P2846R6: `reserve_hint` (PR #206385)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jun 28 22:12:21 PDT 2026
================
@@ -129,6 +130,24 @@ class stride_view : public view_interface<stride_view<_View>> {
{
return std::__to_unsigned_like(ranges::__div_ceil(ranges::distance(__base_), __stride_));
}
+
+# if _LIBCPP_STD_VER >= 26
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto reserve_hint()
+ requires approximately_sized_range<_View>
+ {
+ auto __s = static_cast<range_difference_t<decltype((__base_))>>(ranges::reserve_hint(__base_));
+ return __to_unsigned_like(__div_ceil(__s, __stride_));
----------------
inquisitivecrystal wrote:
Done! I also changed `apply` to `std::apply` in `concat_view.h`.
https://github.com/llvm/llvm-project/pull/206385
More information about the libcxx-commits
mailing list