
1 Feb
2010
1 Feb
'10
4:29 p.m.
Should I be using something like: boost::copy( myvec | sliced(1, myvec.size()), targetvec.begin());
The above example using '|' is my favourite. The other mechanisms will remain supported. The '|' operator is far more readable when one chains adaptors in my opinion, but this is controversial.
Or: boost::copy( make_range(myvec, 1, myvec.size())), targetvec.begin());
In the above IIRC this should be make_sliced_range
or...: boost::copy( make_iterator_range( mvec.begin() + 1, myvec.end(), targetvec.begin() );
The above example isn't compelling, but is indeed legal and works. I hope this helps, Neil Groves