home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stl453up.zip / stl453fx / test / regression / set1.cpp < prev    next >
C/C++ Source or Header  |  2002-04-29  |  648b  |  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 <set>
  7.  
  8. #ifdef MAIN 
  9. #define set1_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15. int set1_test(int, char**)
  16. {
  17.   cout<<"Results of set1_test:"<<endl;
  18.   set<int, less<int> > s;
  19.   cout << "count(42) = " << s.count(42) << endl;
  20.   s.insert(42);
  21.   cout << "count(42) = " << s.count(42) << endl;
  22.   s.insert(42);
  23.   cout << "count(42) = " << s.count(42) << endl;
  24.   int count = s.erase(42);
  25.   cout << count << " elements erased" << endl;
  26.   return 0;
  27. }
  28.