@@ -55,6 +55,20 @@ inline unique_ptr<T> make_unique(size_t size) {
55
55
using scalar_t = typename remove_extent<T>::type;
56
56
return unique_ptr<T>(new scalar_t [size]());
57
57
}
58
+
59
+ template <>
60
+ struct less <void > {
61
+ template <typename T>
62
+ bool operator ()(const T& x, const T& y) const {
63
+ return x < y;
64
+ }
65
+ };
66
+
67
+ template <typename T>
68
+ using result_of_t = typename result_of<T>::type;
69
+
70
+ template <bool B, typename T = void >
71
+ using enable_if_t = typename enable_if<B, T>::type;
58
72
}
59
73
#endif
60
74
@@ -320,7 +334,7 @@ void stl_sort(Iterator begin, Iterator end, Compare compare) {
320
334
}
321
335
322
336
template <typename Iterator>
323
- void stl_sort (Iterator begin, Iterator end, std::less<>) {
337
+ void stl_sort (Iterator begin, Iterator end, std::less<void >) {
324
338
std::sort (begin, end);
325
339
}
326
340
@@ -408,7 +422,7 @@ void ssssort_int(InputIterator begin, InputIterator end,
408
422
* Uses <= 2*(end-begin)*sizeof(value_type) bytes of additional memory.
409
423
*/
410
424
template <typename InputIterator, typename OutputIterator,
411
- typename Compare = std::less<>>
425
+ typename Compare = std::less<void >>
412
426
void ssssort (InputIterator begin, InputIterator end, OutputIterator out_begin, Compare compare = {}) {
413
427
using value_type = typename std::iterator_traits<InputIterator>::value_type;
414
428
static_assert (std::is_convertible<bool , std::result_of_t <Compare (value_type, value_type)>>::value,
@@ -432,7 +446,7 @@ void ssssort(InputIterator begin, InputIterator end, OutputIterator out_begin, C
432
446
*
433
447
* Uses <= 3*(end-begin)*sizeof(value_type) bytes of additional memory
434
448
*/
435
- template <typename Iterator, typename Compare = std::less<>>
449
+ template <typename Iterator, typename Compare = std::less<void >>
436
450
void ssssort (Iterator begin, Iterator end, Compare compare = {}) {
437
451
using value_type = typename std::iterator_traits<Iterator>::value_type;
438
452
static_assert (std::is_convertible<bool , std::result_of_t <Compare (value_type, value_type)>>::value,
0 commit comments