diff options
| author | Nikolas Klauser <nikolasklauser@berlin.de> | 2024-08-27 16:54:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 16:54:05 +0200 |
| commit | d4ffccfce103b01401b8a9222e373f2d404f8439 (patch) | |
| tree | fb79ead2c382c470936e889cc15847a803d84049 /libcxx/src/algorithm.cpp | |
| parent | e8863748ba76462cdbfdcbd7bd99cadf392c01f4 (diff) | |
[libc++] Simplify the implementation of std::sort a bit (#104902)
This does a few things to canonicalize the library a bit. Specifically
- use `__desugars_to_v` instead of the custom `__is_simple_comparator`
- make `__use_branchless_sort` an inline variable
- remove the `_maybe_branchless` versions of the `__sortN` functions and
overload based on whether we can do branchless sorting instead.
Diffstat (limited to 'libcxx/src/algorithm.cpp')
| -rw-r--r-- | libcxx/src/algorithm.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp index af9d60a8e271..a7c39b5e5183 100644 --- a/libcxx/src/algorithm.cpp +++ b/libcxx/src/algorithm.cpp @@ -21,8 +21,7 @@ void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) { std::__introsort<_ClassicAlgPolicy, ranges::less, RandomAccessIterator, - __use_branchless_sort<ranges::less, RandomAccessIterator>::value>( - first, last, ranges::less{}, depth_limit); + __use_branchless_sort<ranges::less, RandomAccessIterator>>(first, last, ranges::less{}, depth_limit); } // clang-format off |
