Mega Code Archive
Assigning sets to each other
#include
#include
#include
using namespace std;
template
void print(T& c){
for( typename T::iterator i = c.begin(); i != c.end(); i++ ){
std::cout << *i << endl;
}
}
int main()
{
set first;
first.insert("r");
first.insert("T");
first.insert("s");
cout << first.size() << endl;
set second (first); // Copy constructor
second.insert("r");
second.insert("K");
second.insert("S");
second.insert("b");
cout << second.size() << endl;
set third = first;
print(first);
print(second);
print(third);
set set2(first);
set2.insert("l");
print(set2);
}