RE: [boost] How to merge set<int>

if you want to use the std::merge algorithm: set<int> c; std::merge(a.begin(), a.end(), b.begin(),b.end(),std::inserter(c, c.end()); but there is a simpler way to do it: set<int> c(a); //copy c'tor c.insert(b.begin(),b.end()); eyal. -----Original Message----- From: zlf [mailto:zlfcn@hotmail.com] Sent: Monday, April 18, 2005 6:52 AM To: boost@lists.boost.org Subject: [boost] How to merge set<int> Hi, I have to sets(set<int> a,b). How to use function [merge] to merge the two sets to another one(set<int> c)? thx zlf _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Hi Eyal Farago, I got it. And thank you for your help :P zlf "Eyal Farago" <eyal.farago@actimize.com> ???? news:BC29F2A417B44F44BD3AA1AD9868CEDC034282@ilexchange.adrembi.com...
if you want to use the std::merge algorithm: set<int> c; std::merge(a.begin(), a.end(), b.begin(),b.end(),std::inserter(c, c.end());
but there is a simpler way to do it: set<int> c(a); //copy c'tor c.insert(b.begin(),b.end());
eyal.
-----Original Message----- From: zlf [mailto:zlfcn@hotmail.com] Sent: Monday, April 18, 2005 6:52 AM To: boost@lists.boost.org Subject: [boost] How to merge set<int>
Hi, I have to sets(set<int> a,b). How to use function [merge] to merge the two sets to another one(set<int> c)? thx zlf
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Eyal Farago
-
zlf