home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl453up.zip / stl453fx / test / regression / stack1.cpp < prev    next >
C/C++ Source or Header  |  2002-04-29  |  554b  |  32 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 <deque>
  8. #include <stack>
  9.  
  10.  
  11. #ifdef MAIN 
  12. #define stack1_test main
  13. #endif
  14.  
  15. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  16. using namespace std;
  17. #endif
  18. int stack1_test(int, char**)
  19. {
  20.   cout<<"Results of stack1_test:"<<endl;
  21.   stack<int, deque<int> > s;
  22.   s.push(42);
  23.   s.push(101);
  24.   s.push(69);
  25.   while(!s.empty())
  26.   {
  27.     cout << s.top() << endl;
  28.     s.pop();
  29.   }
  30.   return 0;
  31. }
  32.