Boost logo

Boost :

Subject: Re: [boost] [mini-review] Update of Boost.Assign (13th-19th of June)
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-06-17 07:59:27


er skrev:
>
>> With a view to promote separation of responsibility between different
>> functions, perhaps we may (also) consider a new function :
>>
>> push_back_range(const V&,const R&);
>>
> > This would tie in with the proposed extension like this:
> >
> > push_back_range(v,cref_csv(1,2,3,4));
> >
> >
>
> On second thought boost::copy is sufficient:
>
> boost::copy(cref_csv(1,2,3,4),std::back_inserter(v));
>
> Also,
>
> BOOST_AUTO( tmp, ref_csv(a,b,c,d));
> boost::copy( v, boost::begin(tmp));
>
> may come in handy.

I would turn my attention to the new Range library:

   boost::push_back( cont, cref_csv(1,2,3,4) );

http://www.boost.org/doc/libs/1_43_0/libs/range/doc/html/range/reference/algorithms/new/push_back.html

-Thorsten


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