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

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