Boost logo

Boost Users :

From: Stefan Arentz (stefan.arentz_at_[hidden])
Date: 2008-02-04 12:52:14


On Feb 4, 2008 6:33 PM, Stefan Arentz <stefan.arentz_at_[hidden]> wrote:
> 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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net