Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main(void){
  6.    
  7.     list<int> li;
  8.     li.push_front(4);
  9.     li.push_front(2);
  10.     li.push_front(1);
  11.     li.push_front(3);
  12.     li.sort();//built in sort algorithm
  13.     while(!li.empty()){
  14.         cout << li.front();
  15.         li.pop_front();
  16.     }
  17.     while(!li.empty()){
  18.         cout <<"Not empty!!";
  19.     }
  20.     return 0;
  21. }