Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-07-26 09:15:52

From: "Toon Knapen" <toon.knapen_at_[hidden]>

> > Sure, I'm all for toys, as in "this doesn't really do everything I'd
> > from a real example, but it shows me how the system works". The problem
> > have with ia_experiment.cpp is that my first reaction was "why would
> > want an "iterator" which does *that*?" The fact that it iterates over
> > two elements and stores its value internally is pretty weird. I think
> > people who have only seen the standard iterators would have a hard time
> > imagining that this is also an iterator. Though technically, it is an
> > iterator, it's so different in nature from most iterators that it seems
> > like it would be completely foreign.
> >
> > What about a singly-linked-list iterator example? Wouldn't that show
> > everything you're illustrating, but more transparently?
> Why not some kind of rotation iterator. The advantage of this example is
> there's a std::rotate in the STL which modifies the container whereas the
> rotation_iterator_adaptor can give you the same result but withouth
> the containers. AFAICT this is a strong argument in favour of the IA.

That's neat, but we already have the permutation adaptor, and I don't think
it's really a simple enough example. Beman's example just makes a simple
iterator, not an adaptor, and I think that's an important feature for a
"hello, world"-type introduction.


           David Abrahams * Boost Consulting
dave_at_[hidden] *

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