Boost logo

Boost :

Subject: Re: [boost] [assignment] += for containers on right side
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2012-07-20 09:19:07


On 19-07-2012 18:00, Jochen Wilhelmy wrote:
> Hi!
>
> is it possible to make += also work for containers on right side?

Many things are possible in C++.

> i.e.
> int a;
> std::vector<int> b;
> std::list<int> c;
> std::vector<int> d;
> d += a,b,c,d;
>
> this would be similar to strings where += at least works with one string
> on the right side.

You could maybe do

push_back( d ).range( a ).range( b ).range( c ).range( d );

-Thorsten


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