Skip to content

Commit a79cc1d

Browse files
committed
fix
1 parent e311615 commit a79cc1d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cp-algo/util/sort.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <vector>
88
namespace cp_algo {
99
template<size_t maxc>
10-
void count_sort(auto &a, auto &&proj = std::identity{}) {
10+
void count_sort(auto &a, auto &&proj) {
1111
std::array<int, maxc> cnt = {};
1212
for(auto &x: a) {
1313
cnt[proj(x)]++;
@@ -19,8 +19,12 @@ namespace cp_algo {
1919
}
2020
a = std::move(res);
2121
}
22+
template<size_t maxc>
23+
void count_sort(auto &a) {
24+
count_sort<maxc>(a, std::identity{});
25+
}
2226

23-
void radix_sort(auto &a, auto &&proj = std::identity{}) {
27+
void radix_sort(auto &a, auto &&proj) {
2428
if(empty(a)) {
2529
return;
2630
}
@@ -34,5 +38,8 @@ namespace cp_algo {
3438
}
3539
});
3640
}
41+
void radix_sort(auto &a) {
42+
radix_sort(a, std::identity{});
43+
}
3744
}
3845
#endif // CP_ALGO_UTIL_SORT_HPP

0 commit comments

Comments
 (0)