Boost logo

Boost Users :

From: ivan_dobrianov (ivan_dobrianov_at_[hidden])
Date: 2002-02-27 16:30:08

Does anyone know of any existing standard tool [an insert iteartor or
something equivalent] that can allow one to perform union, difference,
etc on sets and maps in-place.

E.g. instead of using

set<MyClass> s1, s2, temp;
   s1.begin(), s1.end(),
   s2.begin(), s2.end(),
   inserter(temp, temp.begin()));

i'd like to do, say:

copy(s1.begin(), s1.end(),
   my_unioner(s2, s2.begin()));

which will do s2 = s1 + s2 in LINEAR time.

It's pretty simple to write an inserter like that, but I am just
wondering if there is one already ... or something similar.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at