1// set::clear
2#include <iostream>
3#include <set>
4
5int main ()
6{
7 std::set<int> myset;
8
9 myset.insert (100);
10 myset.insert (200);
11 myset.insert (300);
12
13 std::cout << "myset contains:";
14 for (std::set<int>::iterator it=myset.begin(); it!=myset.end(); ++it)
15 std::cout << ' ' << *it;
16 std::cout << '\n';
17
18 myset.clear();
19 myset.insert (1101);
20 myset.insert (2202);
21
22 std::cout << "myset contains:";
23 for (std::set<int>::iterator it=myset.begin(); it!=myset.end(); ++it)
24 std::cout << ' ' << *it;
25 std::cout << '\n';
26
27 return 0;
28}