Boost logo

Boost :

Subject: [boost] [iostream] closing filtering_ostream
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-11-22 14:29:07


I must be missing something basic, but I cannot find that in Boost.Iostream documentation.
Suppose I am writing into filtering_ostream, and I'm done. I wish to close the ostream,
flushing whatever remaining data and reporting whatever I/O errors arise to user. However:

        base64.cpp:17: error: ‘class boost::iostreams::filtering_ostream’ has no member named ‘close’

The documentation say:

        By default, if the Device at the end of the chain is popped or if the filtering_stream is complete
        when it is destroyed, all the filters and devices in the chain are closed using the function close.

So I assume something is closed in destructor, but what if I don't want the destructor to
potentially throw, and instead what to close the stream explicitly?

- Volodya

P.S. Actually, I'm sure there's a Trac issue saying that potentially throwing destructor is not

Boost list run by bdawes at, gregod at, cpdaniel at, john at