Skip to content

Commit 560f7d8

Browse files
committed
Simplify some uses of __desugars_to with remove_cvref
1 parent ce363a7 commit 560f7d8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

libcxx/include/__algorithm/sort.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <__type_traits/is_constant_evaluated.h>
3535
#include <__type_traits/is_same.h>
3636
#include <__type_traits/is_trivially_copyable.h>
37-
#include <__type_traits/remove_cvref.h>
3837
#include <__utility/move.h>
3938
#include <__utility/pair.h>
4039
#include <climits>
@@ -52,8 +51,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
5251
template <class _Compare, class _Iter, class _Tp = typename iterator_traits<_Iter>::value_type>
5352
inline const bool __use_branchless_sort =
5453
__libcpp_is_contiguous_iterator<_Iter>::value && __is_cheap_to_copy<_Tp> && is_arithmetic<_Tp>::value &&
55-
(__desugars_to_v<__less_tag, __remove_cvref_t<_Compare>, _Tp, _Tp> ||
56-
__desugars_to_v<__greater_tag, __remove_cvref_t<_Compare>, _Tp, _Tp>);
54+
(__desugars_to_v<__less_tag, _Compare, _Tp, _Tp> || __desugars_to_v<__greater_tag, _Compare, _Tp, _Tp>);
5755

5856
namespace __detail {
5957

libcxx/include/__algorithm/stable_sort.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <__type_traits/is_integral.h>
3030
#include <__type_traits/is_same.h>
3131
#include <__type_traits/is_trivially_assignable.h>
32-
#include <__type_traits/remove_cvref.h>
3332
#include <__utility/move.h>
3433
#include <__utility/pair.h>
3534

@@ -246,8 +245,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __stable_sort(
246245
}
247246

248247
#if _LIBCPP_STD_VER >= 17
249-
constexpr auto __default_comp =
250-
__desugars_to_v<__totally_ordered_less_tag, __remove_cvref_t<_Compare>, value_type, value_type >;
248+
constexpr auto __default_comp = __desugars_to_v<__totally_ordered_less_tag, _Compare, value_type, value_type >;
251249
constexpr auto __integral_value =
252250
is_integral_v<value_type > && is_same_v< value_type&, __iter_reference<_RandomAccessIterator>>;
253251
constexpr auto __allowed_radix_sort = __default_comp && __integral_value;

0 commit comments

Comments
 (0)