[libcxx-commits] [libcxx] [libc++] LWG3187: P0591R4 reverted DR 2586 fixes to `scoped_allocator_adaptor::construct()` (PR #152424)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 27 03:20:52 PST 2025
================
@@ -189,19 +281,34 @@ struct __uses_allocator_construction_args<_Type, __enable_if_t<!__is_cv_std_pair
};
template <class _Type, class _Alloc, class... _Args>
-_LIBCPP_HIDE_FROM_ABI constexpr _Type __make_obj_using_allocator(const _Alloc& __alloc, _Args&&... __args) {
- return std::make_from_tuple<_Type>(
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _Type
+__make_obj_using_allocator(const _Alloc& __alloc, _Args&&... __args) {
+ return __uses_allocator_detail::__make_from_tuple<_Type>(
__uses_allocator_construction_args<_Type>::__apply(__alloc, std::forward<_Args>(__args)...));
}
+#endif // _LIBCPP_STD_VER >= 14
+
+#if _LIBCPP_STD_VER >= 17
+
template <class _Type, class _Alloc, class... _Args>
-_LIBCPP_HIDE_FROM_ABI constexpr _Type*
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Type*
__uninitialized_construct_using_allocator(_Type* __ptr, const _Alloc& __alloc, _Args&&... __args) {
return std::apply(
[&__ptr](auto&&... __xs) { return std::__construct_at(__ptr, std::forward<decltype(__xs)>(__xs)...); },
__uses_allocator_construction_args<_Type>::__apply(__alloc, std::forward<_Args>(__args)...));
}
+template <class _Type, class _Alloc, class... _Args>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Type*
+__uninitialized_construct_using_allocator_nocv(_Type* __ptr, const _Alloc& __alloc, _Args&&... __args) {
----------------
frederick-vs-ja wrote:
`nocv` is unfortunately intended. I submitted [LWG4311](https://cplusplus.github.io/LWG/issue4311) for this, but in C++17 perhaps we still need to drop cv-qualification.
https://github.com/llvm/llvm-project/pull/152424
More information about the libcxx-commits
mailing list