Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-29 21:10:48

"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote in message
| I wonder whether Collection Traits can also use Filter Iterator
| (
| as 'collection'.

nope. The requierement is that a default constructed iterator denotes the

| 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. For example

make_filter_range( is_positive_number(), coll );

Using Collection Traits that should be simple. So eventually we can write

  std::copy( boost::make_filter_range( is_positive_number(), numbers ),
                  std::ostream_iterator<int>( std::cout, " " ) )

instead of

  std::copy(boost::make_filter_iterator<is_positive_number>(numbers, numbers
+ N),
                 boost::make_filter_iterator<is_positive_number>(numbers +
N, numbers + N),
                 std::ostream_iterator<int>(std::cout, " "));

Ans similar for other iterators.



Boost list run by bdawes at, gregod at, cpdaniel at, john at