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

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3. #include <iterator>
  4.  
  5. #include <vector>
  6. #include <algorithm>
  7. #include <numeric>
  8. #include <iterator>
  9. #include <iostream>
  10.  
  11. #ifdef MAIN 
  12. #define nextprm2_test main
  13. #endif
  14.  
  15. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  16. using namespace std;
  17. #endif
  18. int nextprm2_test(int, char**)
  19. {
  20.   cout<<"Results of nextprm2_test:"<<endl;
  21.   vector <char> v1(3);
  22.   iota(v1.begin(), v1.end(), 'A');
  23.   ostream_iterator<char> iter(cout);
  24.   copy(v1.begin(), v1.end(), iter);
  25.   cout << endl;
  26.   for(int i = 0; i < 9; i++)
  27.   {
  28.     next_permutation(v1.begin(), v1.end(), less<char>());
  29.     copy(v1.begin(), v1.end(), iter);
  30.     cout << endl;
  31.   }
  32.   return 0;
  33. }
  34.