[libcxx-commits] [libcxx] [libc++] Optimize basic_string::append(Iter, Iter) (PR #169794)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 2 09:18:03 PST 2025


================
@@ -1440,24 +1440,51 @@ public:
   template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
   append(_ForwardIterator __first, _ForwardIterator __last) {
----------------
ldionne wrote:

At the moment, we are not optimizing `append(char8_t*, char8_t*)` into a memmove, but we could. We should figure out how to do that, perhaps in `__copy_non_overlapping_range`.

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


More information about the libcxx-commits mailing list