Boost logo

Boost Users :

Subject: Re: [Boost-users] [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-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net