home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl453up.zip / stl453fx / test / regression / remcpif1.cpp < prev    next >
C/C++ Source or Header  |  2002-04-29  |  636b  |  31 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 remcpif1_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 remcpif1_test(int, char**)
  19. {
  20.   cout<<"Results of remcpif1_test:"<<endl;
  21.  
  22. int numbers[6] = { 1, 2, 3, 1, 2, 3 };
  23. int result[6] = { 0, 0, 0, 0, 0, 0 };
  24.  
  25.   remove_copy_if((int*)numbers, (int*)numbers + 6, (int*)result, odd);
  26.   for(int i = 0; i < 6; i++)
  27.     cout << result[i] << ' ';
  28.   cout << endl;
  29.   return 0;
  30. }
  31.