[libcxx-commits] [libcxx] [libc++] Merge the implementations of ranges::copy_n and std::copy_n and fix vector::insert to assign (PR #157444)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 6 08:11:09 PDT 2025


================
@@ -14,23 +14,48 @@
 #include <__iterator/iterator_traits.h>
 #include <__type_traits/enable_if.h>
 #include <__utility/convert_to_integral.h>
+#include <__utility/move.h>
+#include <__utility/pair.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+template <class _InIter, class _OutIter, __enable_if_t<__has_random_access_iterator_category<_InIter>::value, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_InIter, _OutIter>
----------------
ldionne wrote:

Revisiting this, I think we should be using `AlgorithmPolicy` here instead, like we do in a bunch of other algorithms.

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


More information about the libcxx-commits mailing list