home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / bcompos1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  705b  |  32 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. #include "unary.h"
  8.  
  9.  
  10. #ifdef MAIN 
  11. #define bcompos1_test main
  12. #endif
  13.  
  14. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  15. using namespace std;
  16. #endif
  17. int bcompos1_test(int, char**)
  18. {
  19.   cout<<"Results of bcompos1_test:"<<endl;
  20.  
  21. int array [6] = { -2, -1, 0, 1, 2, 3 };
  22.  
  23.   binary_compose<logical_and<bool>, odd, positive> 
  24.     b = binary_compose<logical_and<bool>, odd, positive>
  25. (logical_and<bool>(), odd(), positive());
  26.   int* p = find_if((int*)array, (int*)array + 6, b);
  27.   if(p != array + 6)
  28.     cout << *p << " is odd and positive" << endl;
  29.  
  30.   return 0;
  31. }
  32.