2626#include < __type_traits/desugars_to.h>
2727#include < __type_traits/enable_if.h>
2828#include < __type_traits/invoke.h>
29+ #include < __type_traits/is_arithmetic.h>
2930#include < __type_traits/is_constant_evaluated.h>
3031#include < __type_traits/is_same.h>
31- #include < __type_traits/is_scalar.h>
3232#include < __type_traits/is_trivially_assignable.h>
3333#include < __utility/move.h>
3434#include < __utility/pair.h>
@@ -202,7 +202,7 @@ struct __stable_sort_switch {
202202#if _LIBCPP_STD_VER >= 17
203203template <class _Tp >
204204_LIBCPP_HIDE_FROM_ABI constexpr unsigned __radix_sort_min_bound () {
205- static_assert (is_scalar <_Tp>::value);
205+ static_assert (is_arithmetic <_Tp>::value);
206206 if constexpr (sizeof (_Tp) == 1 ) {
207207 return 1 << 8 ;
208208 }
@@ -212,7 +212,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr unsigned __radix_sort_min_bound() {
212212
213213template <class _Tp >
214214_LIBCPP_HIDE_FROM_ABI constexpr unsigned __radix_sort_max_bound () {
215- static_assert (is_scalar <_Tp>::value);
215+ static_assert (is_arithmetic <_Tp>::value);
216216 if constexpr (sizeof (_Tp) >= 8 ) {
217217 return 1 << 15 ;
218218 }
@@ -248,11 +248,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __stable_sort(
248248
249249#if _LIBCPP_STD_VER >= 17
250250 constexpr auto __default_comp = __desugars_to_v<__less_tag, _Compare, value_type, value_type >;
251- constexpr auto __scalar_value =
252- is_scalar_v<value_type > && is_same_v< value_type&, __iter_reference<_RandomAccessIterator>>;
253- // There are non-comparable scalars (std::nullptr_t, pointers to members), so we need to exclude them.
254- constexpr auto __comparable_value = is_invocable_r_v<bool , _Compare, value_type, value_type>;
255- if constexpr (__default_comp && __scalar_value && __comparable_value) {
251+ constexpr auto __arithmetic_value =
252+ is_arithmetic_v<value_type > && is_same_v< value_type&, __iter_reference<_RandomAccessIterator>>;
253+ if constexpr (__default_comp && __arithmetic_value) {
256254 if (__len <= __buff_size && __len >= static_cast <difference_type>(std::__radix_sort_min_bound<value_type>()) &&
257255 __len <= static_cast <difference_type>(std::__radix_sort_max_bound<value_type>())) {
258256 if (__libcpp_is_constant_evaluated ()) {
0 commit comments