How do you close a filtering_ostream object once you have finished
writing to it?
In my program below, I would expect the file "hello.bz2" to have been
written once the close() function has been called, but it is not the
case. The contents are not actually written until I exit the scope in
which the filtering_ostream object is defined (at which point the
destructor presumably does the job). (The file "some_text.txt" contains
just the text "hello world!" so I would expect it not to be written
until the file is closed.)
I would like to be able to do this explicitly and not have to rely on
the destruction of the object - could you explain how can this be done?
Another question: what should the second parameter to close() be? I've
used BOOST_IOS::trunc here, but is there some other more appropriate value?
Thanks,
Paul Giaccone
#include <fstream>
#include <iostream>
#include