Boost logo

Boost Users :

Subject: Re: [Boost-users] [range_ex]"Practical" Status of boost::range, boost::range_ex, and associated algorithms
From: Neil Groves (neil_at_[hidden])
Date: 2010-02-01 11:29:34


>
> 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



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