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

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