Boost logo

Boost Users :

From: Chris Weed (chrisweed_at_[hidden])
Date: 2007-10-19 12:30:47


On 10/18/07, dan marsden <danmarsden_at_[hidden]> wrote:
> >I would like to make a subset view of the element in a tuple. It
> >would, for example, give me a view into the first, third, and fifth
> >element of the tuple. It isn't clear how to do this with the available
> >views.
>
> You could do the following (untested):
> * Use zip to zip an mpl range of numeric indexes to your sequence
> * Use filter to extract the positions you want, based on the indices zipped on above
> * Use transform to remove the position labels so the sequence elements are just your desired data.
>
> The above works only if you need const access, as the algorithms return views to const data. If you need non-const data, you can use the corresponding views.
>
> HTH
>
> Cheers
>
> Dan

I figured something like what you proposed was necessary, but I was
hoping there might be a short cut.
Thanks,
Chris


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