Doesnt stl sort require a strict weak ordering to work?
问题 From http://stdcxx.apache.org/doc/stdlibref/less-equal.html -- You can pass a less_equal object to any algorithm that requires a binary function. For example, the sort() algorithm can accept a binary function as an alternate comparison object to sort a sequence. less_equal would be used in that algorithm in the following manner: vector<int> vec1; sort(vec1.begin(), vec1.end(),less_equal<int>()); -- Now I am confused, is the documentation above correct ? 回答1: You are right, std::sort requires