Sure, I'm all for toys, as in "this doesn't really do everything I'd want from a real example, but it shows me how the system works". The problem I have with ia_experiment.cpp is that my first reaction was "why would anyone want an "iterator" which does *that*?" The fact that it iterates over only two elements and stores its value internally is pretty weird. I think most 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
From: "Toon Knapen"
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 modifying 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. -Dave ----------------------------------------------------------- David Abrahams * Boost Consulting dave@boost-consulting.com * http://www.boost-consulting.com