
On Feb 4, 2008 6:33 PM, Stefan Arentz
I'm looking for some help with the following code where I try to implement an aggregate filter and a sink. This super simple example is supposed to print the xorred input but instead it prints:
The result is: do_filter write: 01+x1+x,*!x76=
Does anyone understand why the filtering and sink.write are not done as part of the copy operation? The last two lines should be printed as part of the copy process! It seems they are executed as part of destructing these objects instead?
I got a very useful hint on the #boost irc channel about this: calling out.reset() after the copy() made the code work correctly. I'm a confused about this though since the documentation of copy states: "The function template copy reads data from a given model of Source and writes it to a given model of Sink until the end of stream is reached. It then closes both components, using the function template close, and returns the number of characters written." But when looking at the source of copy() I see there is no close() done at all. Is anyone actually using the library? I can't believe I'm the first finding a bug like this in a 5 year old library. S.