home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / rndshuf1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  752b  |  35 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 <iterator>
  9. #include <numeric>
  10. //#include <functional>
  11.  
  12. #ifdef MAIN 
  13. #define rndshuf1_test main
  14. #endif
  15.  
  16. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  17. using namespace std;
  18. #endif
  19. int rndshuf1_test(int, char**)
  20. {
  21.   cout<<"Results of rndshuf1_test:"<<endl;
  22.   vector <int> v1(10);
  23.   iota(v1.begin(), v1.end(), 0);
  24.   ostream_iterator <int> iter(cout, " ");
  25.   copy(v1.begin(), v1.end(), iter);
  26.   cout << endl;
  27.   for(int i = 0; i < 3; i++)
  28.   {
  29.     random_shuffle(v1.begin(), v1.end());
  30.     copy(v1.begin(), v1.end(), iter);
  31.     cout << endl;
  32.   }
  33.   return 0;
  34. }
  35.