Andy Schweitzer wrote:
eg wrote:
Andrew Schweitzer wrote:
Thanks, I've read that, but it doesn't directly answer my questions. In particular, a) fstream flush seems to work fine, so I'm curious why file_sink doesn't call it and b) given that you can't flush a file_sink what is the appropriate implementation - it seems like there would be one that is relatively straight-forward.
Good questions. I dont know why file_sink or file_descriptor_sink are not currently implemented with the flushable_tag. It looks like it would be very straightforward to add. My usage of iostreams has always involved the gzip filters, which are not flushable either, so I haven't run into this and don't have a solution... other than adding flush support to file_sink. Is there more to it than adding the flushable_tag, and adding a flush function to basic_file_sink and basic_file<Ch>, the latter simply calling pimpl->file_.flush() ?