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

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