home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl2vac.zip / STLport-4_5_3.zip / STLport-4.5.3 / test / regression / genern1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  857b  |  40 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 <iostream>
  7. #include <cstdlib>
  8.  
  9. #include "fadapter.h"
  10.  
  11. #ifdef MAIN 
  12. #define genern1_test main
  13. #endif
  14.  
  15. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  16. using namespace std;
  17. #endif
  18.  
  19.  
  20. static int cxxrand() { return rand();}
  21.  
  22. int genern1_test(int, char**)
  23. {
  24.   cout<<"Results of genern1_test:"<<endl;
  25.  
  26. #ifndef __STL_MEMBER_POINTER_PARAM_BUG        //*TY 07/18/98 - added conditional
  27.                                             // since ptr_gen() is not defined under this condition 
  28.                                             // (see xfunction.h)
  29.   vector <int> v1(10);
  30.  
  31.   generate_n(v1.begin(), v1.size(), ptr_gen(cxxrand));
  32.  
  33.   for(int i = 0; i < 10; i++)
  34.     cout << v1[i] << ' ';
  35.   cout << endl;
  36. #endif    //    __STL_MEMBER_POINTER_PARAM_BUG    //*TY 07/18/98 - added
  37.  
  38.   return 0;
  39. }
  40.