Skip to content

Commit d90d328

Browse files
committed
[libc++] Simplify the implementation of std::sort a bit
1 parent 4589bf9 commit d90d328

File tree

8 files changed

+151
-171
lines changed

8 files changed

+151
-171
lines changed

libcxx/include/__algorithm/comp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ struct __less<void, void> {
4242
}
4343
};
4444

45+
template <class _Tp>
46+
inline const bool __desugars_to_v<__less_tag, __less<>, _Tp, _Tp> = true;
47+
4548
template <class _Tp>
4649
inline const bool __desugars_to_v<__totally_ordered_less_tag, __less<>, _Tp, _Tp> = is_integral<_Tp>::value;
4750

libcxx/include/__algorithm/ranges_minmax.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct __minmax {
8888
// vectorize the code.
8989
if constexpr (contiguous_range<_Range> && is_integral_v<_ValueT> &&
9090
__is_cheap_to_copy<_ValueT> & __is_identity<_Proj>::value &&
91-
__desugars_to_v<__totally_ordered_less_tag, _Comp, _ValueT, _ValueT>) {
91+
__desugars_to_v<__less_tag, _Comp, _ValueT, _ValueT>) {
9292
minmax_result<_ValueT> __result = {__r[0], __r[0]};
9393
for (auto __e : __r) {
9494
if (__e < __result.min)

0 commit comments

Comments
 (0)