[libcxx-commits] [libcxx] [libc++] Partially implement P2846R6: `reserve_hint` (PR #206385)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jun 28 18:42:20 PDT 2026
================
@@ -131,6 +131,59 @@ inline constexpr auto ssize = __ssize::__fn{};
} // namespace __cpo
} // namespace ranges
+# if _LIBCPP_STD_VER >= 26
+
+// [range.prim.size.hint]
+
+namespace ranges {
+namespace __reserve_hint {
+void reserve_hint() = delete;
+
+template <typename _Tp>
+concept __std_size = requires(_Tp&& __t) { ranges::size(__t); };
+
+template <typename _Tp>
+concept __member_reserve_hint = !__std_size<_Tp> && requires(_Tp&& __t) {
+ { auto(__t.reserve_hint()) } -> __integer_like;
+};
+
+template <typename _Tp>
+concept __freestanding_reserve_hint =
----------------
inquisitivecrystal wrote:
Oh, darn. I thought I fixed that. The precedent *from the same file* is to use __unqualified, and I noticed it in a review pass but apparently forgot to fix it. Thank you.
https://github.com/llvm/llvm-project/pull/206385
More information about the libcxx-commits
mailing list