Suppose I have an std::list with several values.

How do I sort them from the smallest to the largest and vice versa? Inside the list. So for example, before soring, my list would have:

2

5

1

7

4

And afterwards, they are sorted:

1

2

4

5

7

I know about the qsort algorithm, but can someone tell me how to actually use it on a list?

Thanks