home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / nextprm1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  708b  |  33 lines

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