Skip to content

Commit 82b0ac2

Browse files
committed
identity
1 parent 48b1d57 commit 82b0ac2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

libcxx/include/__algorithm/radix_sort.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <__algorithm/for_each.h>
1515
#include <__bit/countl.h>
1616
#include <__config>
17+
#include <__functional/identity.h>
1718
#include <__iterator/distance.h>
1819
#include <__iterator/iterator_traits.h>
1920
#include <__iterator/move_iterator.h>
@@ -313,13 +314,6 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __to_unsigned(_Ip __n) {
313314
return static_cast<make_unsigned_t<_Ip> >(__n ^ __min_value);
314315
}
315316

316-
struct __identity_fn {
317-
template <class _Tp>
318-
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Tp&& __value) const {
319-
return std::forward<_Tp>(__value);
320-
}
321-
};
322-
323317
struct __low_byte_fn {
324318
template <class _Ip>
325319
_LIBCPP_HIDE_FROM_ABI constexpr uint8_t operator()(_Ip __integer) const {
@@ -343,13 +337,13 @@ __radix_sort(_RandomAccessIterator1 __first,
343337
template <class _RandomAccessIterator1, class _RandomAccessIterator2>
344338
_LIBCPP_HIDE_FROM_ABI void
345339
__radix_sort(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _RandomAccessIterator2 buffer) {
346-
std::__radix_sort(__first, __last, buffer, __identity_fn{}, __low_byte_fn{});
340+
std::__radix_sort(__first, __last, buffer, __identity{}, __low_byte_fn{});
347341
}
348342

349343
template <class _RandomAccessIterator1, class _RandomAccessIterator2>
350344
_LIBCPP_HIDE_FROM_ABI bool __radix_sort(
351345
_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _RandomAccessIterator2 buffer, _BoolConstant<true>) {
352-
std::__radix_sort(__first, __last, buffer, __identity_fn{}, __low_byte_fn{});
346+
std::__radix_sort(__first, __last, buffer, __identity{}, __low_byte_fn{});
353347
return true;
354348
}
355349

0 commit comments

Comments
 (0)