Boost logo

Boost Users :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-12 06:25:47

"Duane Murphy" <duanemurphy_at_[hidden]> wrote in message
> --- 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
> >Adaptors documentation led me to hope it would answer: "The Iterator
> >library allows you transform an arbitrary ``base'' type into a
> >standard-conforming iterator". If the base type is a container, how do
> >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.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at