// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <list>

using namespace std;

int main()
{
   list<int> lst;
   list<int>::iterator it;
   lst.push_back(3);
   lst.push_back(2);
   lst.push_back(1);
   for(it=lst.begin();it!=lst.end();it++) cout << *it << endl;
   lst.sort();
   for(it=lst.begin();it!=lst.end();it++) cout << *it << endl;
   return 0;
}
