list::sort

void sort();
template<class Pred>
    void sort(greater<T> pr);

Both member functions order the elements in the controlled sequence by a predicate, described below.

For the iterators Pi and Pj designating elements at positions i and j, the first member function imposes the order !(*Pj < *Pi) whenever i < j. (The elements are sorted in ascending order.) The member template function imposes the order !pr(*Pj, *Pi) whenever i < j. No pairs of elements in the original controlled sequence are reversed in the resulting controlled sequence.

In this implementation, if a translator does not support member template functions, the template:

template<class Pred>
    void sort(Pred pr);

is replaced by:

void sort(greater<T> pr);