Boost logo

Boost :

From: Philippe Mori (philippe_mori_at_[hidden])
Date: 2005-04-26 13:10:40


> Hi,
> I have to classes.
>
> class Car;
> class Limousine : public Car{
> ...
> };
>
> And two vector
> vector<Car> Cars;
> vector<Limousine> Limousines;
>
> I want to set vector Limousines's to vector Cars( Cars = Limousines ).
> zlf

Since a Limousine is a Car, you should able to do

    Cars.insert(Cars.end(), Limousines.begin(), Limousines.end());

at least if you have a recent compiler.


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