
"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?
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
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. prematurely.
Would it make sense to have Discard concept which would discard whatever cached data the streams may hold? /Pavel