set1.cpp

We use cookies. Read the Privacy and Cookie Policy

set1.cpp

#include ‹iostream.h›

#include ‹stl.h›

int main() {

 set‹int, less‹int› › s;

 cout ‹‹ "count(42) = " ‹‹ s.count(42) ‹‹ endl;

 s.insert(42);

 cout ‹‹ "count(42) = " ‹‹ s.count(42) ‹‹ endl;

 s.insert(42);

 cout ‹‹ "count(42) = " ‹‹ s.count(42) ‹‹ endl;

 int count = s.erase(42);

 cout ‹‹ count ‹‹ " elements erased" ‹‹ endl;

 return 0;

}