Boost logo

Boost Users :

From: Julia Donawald (yg-boost-users_at_[hidden])
Date: 2002-11-29 05:42:46


Hi,

I am trying to write my own iterator - class and using for that the
boost::iterator_adaptor. I could find on the webpage several examples of how
to connect an existing iterator like std::string::iterator or a simple array
as "base-class" for my new iterator, but what can I do if I dont have any
base-iterator? In the documentation I found the following sentence: "The
Iterator Adaptor library allows you transform an arbitrary ``base'' type
into a standard-conforming iterator with the behaviors you choose. Doing so
is especially easy if the ``base'' type is itself an iterator." In my
situation I dont have any base type which is an iterator ( as base type I
have a simple int ), so how should I now create such a base-type? Which are
the specifications of such a base-type? Where can I get information on how
to create a new base-type?

I am trying to write an iterator which reads records from a file or a
database and always when I do the it++ the next record is read from the file
or database.

Bye,
Julia


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net