append set to another set

Posted by mr.bio on Stack Overflow See other posts from Stack Overflow or by mr.bio
Published on 2010-04-09T12:13:21Z Indexed on 2010/04/09 12:23 UTC
Read the original article Hit count: 655

Filed under:
|
|
|

Hi

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 ?

© Stack Overflow or respective owner

Related posts about c++

Related posts about set