Is there a better way of appending a set to another set than iterating through each element ?
i have :
set<string> foo ;
set<string> bar ;
.....
for (set<string>::const_iterator p = foo.begin( );p != foo.end( ); ++p)
bar.insert(*p);
Is there a more efficient way to do this ?
You can insert a range:
bar.insert(foo.begin(), foo.end());