I've started doing a conversion of many old iterators to the new iterators. I also have been going through the docs, so I thought I would add a few comments. --- At Thu, 2 Dec 2004 13:07:48 -0500, David Abrahams wrote:
Martin Wartens wrote:
I have to say that the documentation was not of much help to me. There are lots of complicated implementation details but only small examples.
You're not kidding? Did you go through the tutorial starting with iterator_facade (http://tinyurl.com/2gzpz#tutorial-example) which continues on to the iterator adaptor tutorial (http://tinyurl.com/58e2p#tutorial-example)? Gee, it looks from the below like you did!
No, I am serious. Looking at the iterator_facade doc, first of all it does not tell me what it is all about. The one sentence in the abstract is indeed very abstract.
Wow, good point.
The biggest thing missing for me is what the difference is between facade and adaptor. In particular when would you choose one over the other. I think i know the answer, but it wasn't clear that the docs explained that very well.
I would like to see more examples, if that is possible.
Hm. Examples of what?
The example with details shows a forward iterator that can also be used as an adaptor. Clever for continuity, but reality is seldom that cooperative. I would like to see a full random access facade. For example: build the full suite of four iterators for std::vector from the outside of std: :vector. That is assume std::vector had no iterators; how would iterators be implemented?
I hope this didn't sound rude, I know it must be hard to write a doc for such a complicated library.
Yes, but that usually means the library needs to be simplified ;-)
I have found boost::iterator to be awesome. Using boost::iterator to build new iterators is actually easier than the docs seem to make it out to be. It seems like it might be a case of "you can't see the forest because of the trees." ...Duane