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

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <iostream>
  5. #include <vector>
  6. #include <algorithm>
  7.  
  8. #ifdef MAIN 
  9. #define iter2_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15. static void print(const vector<const char*>& v_)
  16. {
  17.   std::vector<const char*>::const_iterator i;
  18.   for(i = v_.begin(); i != v_.end(); i++)
  19.     cout << *i << endl;
  20. }
  21. int iter2_test(int, char**)
  22. {
  23.   cout<<"Results of iter2_test:"<<endl;
  24.   vector<const char*> v;
  25.   v.push_back((char*) "zippy");
  26.   v.push_back((char*) "motorboy");
  27.   print(v);
  28.   return 0;
  29. }
  30.