Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-05-10 22:09:14

Alisdair Meredith <alisdair.meredith_at_[hidden]> writes:

> This is clear when we look at algorithms that take a range for input and
> an output iterator, eg transform. Where I see a range and an iterator,
> your library tries to see two containers. I'm not entirely convinced
> this is the way to go.

>From working with the MPL, which does almost everything in terms of
sequences, I can say it is occasionally inconvenient to come up with
two sequences for an algorithm like the 2-sequence form of
transform. If you just have an iterator into the 2nd sequence, it
may be hard to come up with another one to mark the end. That's
especially true in the runtime world, where single-pass iterators are
possible (think istream_iterator).

> Likewise, for me a container is simply one form of range, but I can
> imagine many others. Perhaps I should take a look at the Views
> library? To phrase the library in terms of containers seems to limit
> it, to me.

I like your approach, FWIW. It's easy enough to get an iterator out
of a sequence when you need one. It can be harder to come up with a
sequence given an iterator.

Dave Abrahams
Boost Consulting

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