Skip to content

Commit

Permalink
Reapply "[libc++] Simplify the implementation of std::sort a bit (#10…
Browse files Browse the repository at this point in the history
…4902)"

This reverts commit ef44e46.
  • Loading branch information
philnik777 committed Oct 29, 2024
1 parent 05b6c2e commit b347d20
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 171 deletions.
3 changes: 3 additions & 0 deletions libcxx/include/__algorithm/comp.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ struct __less<void, void> {
}
};

template <class _Tp>
inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;

template <class _Tp>
inline const bool __desugars_to_v<__totally_ordered_less_tag, __less<>, _Tp, _Tp> = is_integral<_Tp>::value;

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__algorithm/ranges_minmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct __minmax {
// vectorize the code.
if constexpr (contiguous_range<_Range> && is_integral_v<_ValueT> &&
__is_cheap_to_copy<_ValueT> & __is_identity<_Proj>::value &&
__desugars_to_v<__totally_ordered_less_tag, _Comp, _ValueT, _ValueT>) {
__desugars_to_v<__less_tag, _Comp, _ValueT, _ValueT>) {
minmax_result<_ValueT> __result = {__r[0], __r[0]};
for (auto __e : __r) {
if (__e < __result.min)
Expand Down
Loading

0 comments on commit b347d20

Please sign in to comment.