[libcxx-commits] [libcxx] [libc++] [sort] Improve performance of std::sort (PR #76616)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 30 07:08:50 PST 2023


================
@@ -144,7 +144,7 @@ template <class _Compare, class _Iter, class _Tp = typename iterator_traits<_Ite
 using __use_branchless_sort =
     integral_constant<bool,
                       __libcpp_is_contiguous_iterator<_Iter>::value && sizeof(_Tp) <= sizeof(void*) &&
-                          is_arithmetic<_Tp>::value && __is_simple_comparator<_Compare>::value>;
+                          is_trivially_copyable<_Tp>::value && __is_simple_comparator<_Compare>::value>;
----------------
mordante wrote:

Are there already tests for sorting trivially_copyable types?

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


More information about the libcxx-commits mailing list