Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-05-06 14:21:21


Vladimir Prus wrote:

>Thorsten Ottosen wrote:
>
>
>
>>"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote in message
>>news:c6s7rh$fc9$1_at_sea.gmane.org...
>>| I wonder whether Collection Traits can also use Filter Iterator
>>| (http://www.boost.org/libs/iterator/doc/filter_iterator.html)
>>| as 'collection'.
>>
>>nope. The requierement is that a default constructed iterator denotes the
>>end.
>>
>>
>
>I think it's possible to create iterator adaptor which makes default
>constructed iterator denote the end. Hey, it's 10 mins effort, see
>
> http://zigzag.cs.msu.su:7813/implicit_eof_iterator
>
>I'm not yet sure if this is better/worse than views, but definitely
>Collection Traits need to have special support for Filter iterator. Either
>we need views, or we need such wrapper iterator.
>
>
>
>>| Or even whether it can simplify use of Filter Iterator a bit.
>>
>>I think the key for simpler use of all of the iterators in Boost.Iterator
>>is to define
>>special range versions of make_XX. I hope John and Matthew will do this in
>>their range
>>lib.
>>
>>
>
>Where can I look at this lib, and how it's different/related to the views
>library in the sandbox?
>
>
>
www.torjo.com/code/for_boost.zip (note, it contains several also other
things)

it's more general ;)
at this time, it uses the traverable range concept, like this;
for( crange<some_container> r(c); r; ++r)
   do_whatever(r);

it contains the STL algorithms adapted for ranges,
and you can compose ranges. Example:
filtered(transformed(c,some_transform),some_filter);

When we'll have the time, we'll post an update to the Ranges Library.
Unfortunately I think this will only happen in a few months :(

-- 
John Torjo
Freelancer
-- john_at_[hidden]
-- http://www.torjo.com/logview/ - viewing/filtering logs is just too easy!

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk