
17 Jun
2010
17 Jun
'10
11:59 a.m.
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/alg... -Thorsten