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 / alg3.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  585b  |  31 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.  
  8.  
  9. #ifdef MAIN 
  10. #define alg3_test main
  11. #endif
  12.  
  13. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  14. using namespace std;
  15. #endif
  16. int alg3_test(int, char**)
  17. {
  18.   cout<<"Results of alg3_test:"<<endl;
  19.   int n=0;
  20.   vector<int> i;
  21.   i.push_back(1);
  22.   i.push_back(4);
  23.   i.push_back(2);
  24.   i.push_back(8);
  25.   i.push_back(2);
  26.   i.push_back(2);
  27.   count(i.begin(), i.end(), 2, n);
  28.   cout << "Count of 2s = " << n << endl;
  29.   return 0;
  30. }
  31.