[libcxx-commits] [libcxx] [libc++] Destroy elements when exceptions are thrown in __construct_at_end (PR #167112)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 16 17:43:09 PST 2025


================
@@ -142,6 +155,20 @@ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
   return std::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
 }
 
+// __uninitialized_default_construct_n_with_alloc
+
+template <class _Alloc, class _ForwardIterator, class _Size>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
+__uninitialized_default_construct_n_with_alloc(_Alloc& __alloc, _ForwardIterator __first, _Size __n) {
----------------
frederick-vs-ja wrote:

```suggestion
// __uninitialized_allocator_value_construct_n

template <class _Alloc, class _ForwardIterator, class _Size>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
__uninitialized_allocator_value_construct_n(_Alloc& __alloc, _ForwardIterator __first, _Size __n) {
```

https://github.com/llvm/llvm-project/pull/167112


More information about the libcxx-commits mailing list