Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-09-04 17:04:54


"Jonathan Turkanis" wrote:

> > I meant something like:
> >
> > repeater_stream(repeat(2, 'a', 'b', 'c', 'd', repeat('e', 4)), 'f',
'g');
> >
> > which would produce sequence:
> >
> > a, b, c, d, e, e, e, e,
> > a, b, c, d, e, e, e, e,
> > f, g
> > and again
> >
> > The syntax is secondary, main point is that the generated data could
> > be typed easily.
>
> Could you give an example application?
>
Generator of tests for compression engine.

But it coule be worked around:
vector<char> v;
v += 'a, b', repeat(.....), .......
stream_from_vector s(v);

so its not really needed. Just be be able to repeat
input collection N times or forever should be enough.

> > > Doable, but presents some problems with buffer synchronization. There
is
> > > currently no generic sync() function or Synchronizable concept.
> > >
> > Maybe this could be added (with Flush name)?
>
> I had this before, but ripped it out when I added close -- probably
prematurely.
>
Would it make sense to have Discard concept which would discard
whatever cached data the streams may hold?

/Pavel


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