home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / remif1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  574b  |  30 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <algorithm>
  5. #include <iostream>
  6.  
  7. #ifdef MAIN 
  8. #define remif1_test main
  9. #endif
  10. static bool odd(int a_)
  11. {
  12.   return a_ % 2;
  13. }
  14.  
  15. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  16. using namespace std;
  17. #endif
  18. int remif1_test(int, char**)
  19. {
  20.   cout<<"Results of remif1_test:"<<endl;
  21.  
  22. int numbers[6] = { 0, 0, 1, 1, 2, 2 };
  23.  
  24.   remove_if((int*)numbers, (int*)numbers + 6, odd);
  25.   for(int i = 0; i < 6; i++)
  26.     cout << numbers[i] << ' ';
  27.   cout << endl;
  28.   return 0;
  29. }
  30.