Boost logo

Boost :

From: Moore, Paul (paul.moore_at_[hidden])
Date: 2001-03-09 11:34:36


I just grabbed Boost 1.21.0 (I don't track the CVS stuff), and I have had a
quick glance at the iterator adapters library.

One thing that struck me was that, although there is a Function Output
Iterator Adapter, what I often feel the need for is a function *input*
iterator, specifically an input iterator which returns the results of
calling a function repeatedly. The obvious example of something like this is
a lexer, where you often find lexer functions, but what you would really
like is an input iterator which generates tokens one after another.

Does the iterator adaptors library offer a way of doing this? I couldn't see
anything at a first glance... I think it would be very helpful to add, as
writing input iterators is a bit subtle (it nearly always takes me a couple
of goes to get the behaviour right).

There is one obvious issue, namely that it's not easy to define an "end"
condition. istream_iterators have EOF, but a general function could signal
an "end" to its stream of values in all sorts of ways, not least of which is
having no end at all (consider a random number generator).

I'll look into all this a bit more closely as soon as I get the time...

Paul.

PS Is there any way of getting the Boost documentation packaged up into
something printable for offline use? HTML is all very well, but it's not
really on to try to print each page manually. Maybe it's time to consider
some form of documentation guidelines...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk