"Duane Murphy"
--- At Tue, 4 Jun 2002 13:02:08 +0100, Keith MacDonald wrote:
So, what is the "normal" way of creating an iterator out of thin air as it were?
That was the question in my mind, which the first sentence of the Iterator Adaptors documentation led me to hope it would answer: "The Iterator Adaptor library allows you transform an arbitrary ``base'' type into a standard-conforming iterator". If the base type is a container, how do you do it?
Keith, Your email was delayed in my queue for some reason. Were you able to figure out how to do an iterator from a container from the discussion between Dave Abrahms and myself?
Well, of course you have to think about what data the iterator will need in order to do the iteration. The Base type can't be just a container if you want the iterator to traverse the container's elements -- you need to store some indication of the position within the container -- e.g. a node pointer, and index, or an interator -- as (part of) the Base type. -Dave
participants (1)
-
David Abrahams