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

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <functional>
  5. #include <algorithm>
  6. #include <iostream>
  7.  
  8. #ifdef MAIN 
  9. #define lexcmp2_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15. int lexcmp2_test(int, char**)
  16. {
  17.   cout<<"Results of lexcmp2_test:"<<endl;
  18. const unsigned size = 6;
  19. char n1[size] = "shoe";
  20. char n2[size] = "shine";
  21.  
  22.   bool before =
  23.     lexicographical_compare(n1, n1 + size,
  24.                              n2, n2 + size,
  25.                              greater<char>());
  26.   if(before)
  27.     cout << n1 << " is after " << n2 << endl;
  28.   else
  29.     cout << n2 << " is after " << n1 << endl;
  30.   return 0;
  31. }
  32.