home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / copy3.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  628b  |  29 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 copy3_test main
  11. #endif
  12.  
  13. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  14. using namespace std;
  15. #endif
  16. int copy3_test(int, char**)
  17. {
  18.   cout<<"Results of copy3_test:"<<endl;
  19.   vector <int> v1(10);
  20.   for(int i = 0; i < v1.size(); i++)
  21.     v1[i] = i;
  22.   vector <int> v2(10);
  23.   copy(v1.begin(), v1.end(), v2.begin());
  24.   ostream_iterator<int> iter(cout, " ");
  25.   copy(v2.begin(), v2.end(), iter);
  26.   cout << endl;
  27.   return 0;
  28. }
  29.