Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-10-26 11:17:49


"Russell Hind" <rh_gmane_at_[hidden]> wrote in message
news:cll9ma$fi4$1_at_sea.gmane.org...
> There seems to be a problem on win32 where if you use a stream opened in
> text mode for a binary archive, you get errors. The following code
> asserts because 'd' appears to have a random value on the way back in.
>
> If you open both streams in binary mode then the code runs fine. XML
> archives don't have the same problem.

> I realise you shouldn't use a binary archive with a text stream, but is
> there anyway to catch this at compile or run time? Otherwise you just
> end up with a corrupted archive?

I looked hard for a way to determine whether a previously open stream was
opened in binary or text mode. I was unable to find a way to do this -
portable or otherwise. The assertion was the best I could do.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk