Skip to content

Commit 88c8381

Browse files
committed
fixed strict comparator crash
1 parent 73f7901 commit 88c8381

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

include/vector.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ class vector
577577
}
578578
#endif
579579

580-
// Sorts the vector in place in ascending order, when its elements support comparison by std::less_equal [<=] (mutating).
580+
// Sorts the vector in place in ascending order, when its elements support comparison by std::less [<] (mutating).
581581
//
582582
// example:
583583
// fcpp::vector numbers({3, 1, 9, -4});
@@ -587,19 +587,19 @@ class vector
587587
// numbers -> fcpp::vector({-4, 1, 3, 9});
588588
vector& sort_ascending()
589589
{
590-
return sort(std::less_equal<T>());
590+
return sort(std::less<T>());
591591
}
592592

593593
#ifdef PARALLEL_ALGORITHM_AVAILABLE
594594
// Performs the `sort_ascending` algorithm in parallel.
595595
// See also the sequential version for more documentation.
596596
vector& sort_ascending_parallel()
597597
{
598-
return sort_parallel(std::less_equal<T>());
598+
return sort_parallel(std::less<T>());
599599
}
600600
#endif
601601

602-
// Sorts the vector in place in descending order, when its elements support comparison by std::greater_equal [>=] (mutating).
602+
// Sorts the vector in place in descending order, when its elements support comparison by std::greater [>] (mutating).
603603
//
604604
// example:
605605
// fcpp::vector numbers({3, 1, 9, -4});
@@ -609,15 +609,15 @@ class vector
609609
// numbers -> fcpp::vector({9, 3, 1, -4});
610610
vector& sort_descending()
611611
{
612-
return sort(std::greater_equal<T>());
612+
return sort(std::greater<T>());
613613
}
614614

615615
#ifdef PARALLEL_ALGORITHM_AVAILABLE
616616
// Performs the `sort_ascending` algorithm in parallel.
617617
// See also the sequential version for more documentation.
618618
vector& sort_descending_parallel()
619619
{
620-
return sort_parallel(std::greater_equal<T>());
620+
return sort_parallel(std::greater<T>());
621621
}
622622
#endif
623623

@@ -671,7 +671,7 @@ class vector
671671
}
672672
#endif
673673

674-
// Sorts its elements copied and sorted in ascending order, when its elements support comparison by std::less_equal [<=] (non-mutating).
674+
// Sorts its elements copied and sorted in ascending order, when its elements support comparison by std::less [<] (non-mutating).
675675
//
676676
// example:
677677
// const fcpp::vector numbers({3, 1, 9, -4});
@@ -681,19 +681,19 @@ class vector
681681
// sorted_numbers -> fcpp::vector({-4, 1, 3, 9});
682682
[[nodiscard]] vector sorted_ascending() const
683683
{
684-
return sorted(std::less_equal<T>());
684+
return sorted(std::less<T>());
685685
}
686686

687687
#ifdef PARALLEL_ALGORITHM_AVAILABLE
688688
// Performs the `sorted_ascending` algorithm in parallel.
689689
// See also the sequential version for more documentation.
690690
[[nodiscard]] vector sorted_ascending_parallel() const
691691
{
692-
return sorted_parallel(std::less_equal<T>());
692+
return sorted_parallel(std::less<T>());
693693
}
694694
#endif
695695

696-
// Sorts its elements copied and sorted in descending order, when its elements support comparison by std::greater_equal [>=] (non-mutating).
696+
// Sorts its elements copied and sorted in descending order, when its elements support comparison by std::greater [>] (non-mutating).
697697
//
698698
// example:
699699
// const fcpp::vector numbers({3, 1, 9, -4});
@@ -703,15 +703,15 @@ class vector
703703
// sorted_numbers -> fcpp::vector({9, 3, 1, -4});
704704
[[nodiscard]] vector sorted_descending() const
705705
{
706-
return sorted(std::greater_equal<T>());
706+
return sorted(std::greater<T>());
707707
}
708708

709709
#ifdef PARALLEL_ALGORITHM_AVAILABLE
710710
// Performs the `sorted_descending` algorithm in parallel.
711711
// See also the sequential version for more documentation.
712712
[[nodiscard]] vector sorted_descending_parallel() const
713713
{
714-
return sorted_parallel(std::greater_equal<T>());
714+
return sorted_parallel(std::greater<T>());
715715
}
716716
#endif
717717

0 commit comments

Comments
 (0)