Boost logo

Boost Users :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2006-01-27 12:36:29


Seweryn Habdank-Wojewódzki wrote:

>Hello
>
>I would like to ask for consideration of some new functionality for
>boost::serialization.
>
>If I have a stream and I do not want to close the stream at the end of
>serialization I have to make easy, but nasty trick using stringstream as a
>buffer between my stream and serialized stream.
>
>

I raised this issue a few months ago. It turns out that the only way of
closing a stream at the end of serialisation is to leave the scope in
which the stream was opened. The reason for this is, I believe, so that
a "footer" can be written to the stream indicating the end of the file.

It would be handy, as Seweryn suggests, if there could be a close()
function available to users that did this, so that users could close the
stream when they needed to. One application of this is allowing a
stream to be used for writing and then reading within the same scope.
At the moment, a new scope is required to do this.

Paul


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