[libcxx-commits] [PATCH] D147741: [libc++] unwrap iterator parameters to __uninitialized_allocator_copy before calling std::copy
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 12 08:53:49 PDT 2023
philnik added inline comments.
================
Comment at: libcxx/include/__memory/uninitialized_algorithms.h:553-558
+ /* Adding this calls the other overload for vector<int>
+ class _RawType = __remove_const_t<_Iter2>,
+ __enable_if_t<
+ // using _RawType because of the allocator<T const> extension
+ !is_trivially_copy_constructible<_RawType>::value || !is_trivially_copy_assignable<_RawType>::value ||
+ !__allocator_has_trivial_copy_construct<_Alloc, _RawType>::value>* */ >
----------------
I think this can be fixed by using different types for the `__first1` and `__first2` pointers and adding the condition `is_same<__remove_cv_t<_Type1>, __remove_cv_t<_Type2>>::value` to the `enable_if` in the raw pointer overload. Then that overload will always have priority over the more generic one. Then this overload (the generic one) doesn't need any `enable_if`s.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147741/new/
https://reviews.llvm.org/D147741
More information about the libcxx-commits
mailing list