Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-12-09 14:56:47

Bob Bell wrote:
> Dave-
> I was looking over my "sent" items and I think something was wrong with
> my return address, so I'm resending this with the right address. Sorry
> for any confusion it may have caused.


Please post Boost questions to one of the Boost mailing lists (unless
you want to hire us for consulting services, that is!)

> I've been using the boost iterator adaptor library, and first let me say
> thanks; it's really a great library.

You're welcome :)

> Having said that, however, I'm having a problem. I'm trying to build an
> iterator that uses both boost::filter_iterator and
> boost::transform_iterator, but what happens is that when I combine these
> two adaptors, it seems to lose the iterator category of the original
> iterator. That is, say I build an iterator like this:
> boost::transform_iterator<SomeTransform,
> boost::filter_iterator<SomeFilter, int*> >
> The resulting iterator only seems to be a forward iterator. My
> understanding is that the iterator category of the base iterator (int*),
> should become the category of the resulting composite. So my first
> question is: is this a correct understanding on my part?

Not according to

A filter iterator is never more than a forward iterator.


Dave Abrahams
Boost Consulting

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