[libcxx-commits] [PATCH] D118029: Introduce branchless sorting functions for sort3, sort4 and sort5.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 15 02:09:57 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/__algorithm/sort.h:127
+template <class _Iter, class _Tp = typename iterator_traits<_Iter>::value_type>
+using __use_branchless_sort = bool_constant< __is_cpp17_contiguous_iterator<_Iter>::value &&
+                                             sizeof(_Tp) <= sizeof(void*) && is_arithmetic<_Tp>::value >;
----------------
marcogelmi wrote:
> bool_constant seems to need >= c++14, any suggestion on how to make this work for c++03?
use `_LIBCPP_BOOL_CONSTANT`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118029/new/

https://reviews.llvm.org/D118029



More information about the libcxx-commits mailing list