home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl453up.zip / stl453fx / test / regression / stack2.cpp < prev    next >
C/C++ Source or Header  |  2002-04-29  |  551b  |  31 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <iostream>
  5. #include <algorithm>
  6. #include <queue>
  7. #include <list>
  8. #include <stack>
  9.  
  10. #ifdef MAIN 
  11. #define stack2_test main
  12. #endif
  13.  
  14. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  15. using namespace std;
  16. #endif
  17. int stack2_test(int, char**)
  18. {
  19.   cout<<"Results of stack2_test:"<<endl;
  20.   stack<int, list<int> > s;
  21.   s.push(42);
  22.   s.push(101);
  23.   s.push(69);
  24.   while(!s.empty())
  25.   {
  26.     cout << s.top() << endl;
  27.     s.pop();
  28.   }
  29.   return 0;
  30. }
  31.