home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl2vac.zip / STLport-4_5_3.zip / STLport-4.5.3 / test / regression / setunon2.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  841b  |  36 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <algorithm>
  5. #include <iostream>
  6. #include <cstring>
  7. #include <iterator>
  8. #include <functional>
  9.  
  10. #ifdef MAIN 
  11. #define setunon2_test main
  12. #endif
  13.  
  14. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  15. using namespace std;
  16. #endif
  17. int setunon2_test(int, char**)
  18. {
  19.   cout<<"Results of setunon2_test:"<<endl;
  20. char* word1 = "ABCDEFGHIJKLMNO";
  21. char* word2 = "LMNOPQRSTUVWXYZ";
  22.  
  23.   ostream_iterator <char> iter(cout, " ");
  24.   cout << "word1: ";
  25.   copy(word1, word1 + ::strlen(word1), iter);
  26.   cout << "\nword2: ";
  27.   copy(word2, word2 + ::strlen(word2), iter);
  28.   cout << endl;
  29.   set_union(word1, word1 + ::strlen(word1),
  30.              word2, word2 + ::strlen(word2),
  31.              iter,
  32.              less<char>());
  33.   cout << endl;
  34.   return 0;
  35. }
  36.