Skip to content

Commit d95ecbd

Browse files
committed
fix-dispatch-locally
1 parent f12b9cd commit d95ecbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcxx/include/__algorithm/stable_sort.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <__type_traits/desugars_to.h>
2525
#include <__type_traits/enable_if.h>
2626
#include <__type_traits/is_integral.h>
27+
#include <__type_traits/is_same.h>
2728
#include <__type_traits/is_trivially_assignable.h>
2829
#include <__type_traits/remove_cvref.h>
2930
#include <__utility/move.h>
@@ -242,7 +243,8 @@ void __stable_sort(_RandomAccessIterator __first,
242243
#if _LIBCPP_STD_VER >= 17
243244
constexpr auto __default_comp =
244245
__desugars_to_v<__totally_ordered_less_tag, __remove_cvref_t<_Compare>, value_type, value_type >;
245-
constexpr auto __integral_value = is_integral_v<value_type >;
246+
constexpr auto __integral_value =
247+
is_integral_v<value_type > && is_same_v< value_type&, iter_reference_t<_RandomAccessIterator>>;
246248
constexpr auto __allowed_radix_sort = __default_comp && __integral_value;
247249
if constexpr (__allowed_radix_sort) {
248250
if (__len <= __buff_size && __len >= static_cast<difference_type>(__radix_sort_min_bound<value_type>()) &&

0 commit comments

Comments
 (0)