#include <list>
#include <algorithm>
int main() {
   std::list<int> v;
   std::stable_sort(v.begin(), v.end());
   return 0;
}

Example 2: A common programming error when using the STL.

Back to Article