From: "Jeremy Siek"
Here's another idea for a "hello world" example. A rewrite of Matt Austern's line_iterator example from his Generic Programming and the STL book. The line_iterator call getline() and then return a std::string from operator*.
On Fri, 26 Jul 2002, David Abrahams wrote: dave> dave> That's neat, but we already have the permutation adaptor, and I dave> don't think it's really a simple enough example. Beman's example dave> just makes a simple iterator, not an adaptor, and I think that's an dave> important feature for a "hello, world"-type introduction. dave> dave> -Dave
Don't you think people will find an iterator which traverses the elements of a real sequence to be more-obvious? That's why I'm suggesting the singly-linked list iterator. ----------------------------------------------------------- David Abrahams * Boost Consulting dave@boost-consulting.com * http://www.boost-consulting.com