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 / copy2.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  558b  |  27 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 <iterator>
  8.  
  9. #ifdef MAIN 
  10. #define copy2_test main
  11. #endif
  12.  
  13. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  14. using namespace std;
  15. #endif
  16. int copy2_test(int, char**)
  17. {
  18.   cout<<"Results of copy2_test:"<<endl;
  19.   vector <int> v(10);
  20.   for(int i = 0; i < v.size(); i++)
  21.     v[i] = i;
  22.   ostream_iterator<int> iter(cout, " ");
  23.   copy(v.begin(), v.end(), iter);
  24.   cout << endl;
  25.   return 0;
  26. }
  27.