
13 May
2004
13 May
'04
11:37 a.m.
Thanks for the advice. I think I have it now. Problem: A function F accepts a pair of stl-style iterators as input. A nullary functor G can generate an output. Arrange for F to call G n times without storing to an intermediate sequence. Example: G is a random number generator. I wonder if there is a more elegant approach? Here is what I came up with. It is almost perfect, there seems to be 1 extra call to G() that I haven't accounted for, but this may or may not be important.