You are right, std::sort
requires the comparer to define a strict weak ordering.
Which means that std::less_equal
should not be used with std::sort
. It can still be used with a number of other standard algorithms though, which take a binary function and which do not have the strict weak ordering requirement.