Boost logo

Boost :

From: Eyal Farago (eyal.farago_at_[hidden])
Date: 2005-04-18 03:25:08


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_at_[hidden]]
Sent: Monday, April 18, 2005 6:52 AM
To: boost_at_[hidden]
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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk