Boost logo

Boost Users :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2005-11-11 06:23:50


Kevin Wheatley wrote:

>Ian McCulloch wrote:
>
>
>>I don't really have an opinion here, but why is it the job of the
>>serialization library to attempt to detect completely unrelated programmer
>>errors?
>>
>>
>
>My concern is that the library can write out something it cannot read
>back in... this conflicts with its most obvious use, taking an object,
>writing it to disc, reading it back in, exactly as it was before
>writing to disc (assuming same machine reading writing, ignoring
>memory locations for pointers etc).
>
>

I quite agree. Cutting through all the discussion that there has been
on this subject, surely the issue here, as has already been said, is
that the library should trap the error when *writing* any value that
will cause an error when it is read back in, instead of when it is being
*read back in*, as is currently happening. Allowing an value to be
written that cannot be read back looks like a bug to me.

Consideration of whether or not to allow reading and writing of NaN,
+/-inf, etc, is a side issue (albeit one worthy of discussion) as I
would expect the read and write behaviour to be the same for these
values. If it is not, this is something else that needs to be considered.

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