[libcxx-commits] [libcxx] [libc++] [sort] Improve performance of std::sort (PR #76616)
Christopher Di Bella via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 2 10:57:01 PST 2024
================
@@ -171,6 +172,7 @@ inline _LIBCPP_HIDE_FROM_ABI void
__partially_sorted_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
// Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
+ static_assert(is_trivially_copyable<value_type>::value, "");
----------------
cjdb wrote:
Please add a helpful message about why this is a requirement.
https://github.com/llvm/llvm-project/pull/76616
More information about the libcxx-commits
mailing list