Pfligersdorffer, Christian wrote:
there _is_ a portable binary archive provided with the examples but as Robert Ramey points out in the code documentation, it is not complete as it lacks the floating point conversion. But if Johan is willing to fill this gap I am perfectly confident that we could have a comprehensive implementation in a few weeks. That is, if the issue that Dan Leibovich found in the example can be resolved.
I follow the portable archive discussion with great interest since I would very much like to use it too.
PS @ Cliff: Very interesting post! Do you know about when and if the endian library will enter the official boost release? I would find that useful too.
Regards,
-- Christian Pfligersdorffer Software Engineering EOS GmbH
Here is a rough sketch for how to deal with some of the issues: 1. Only support platforms with IEEE754 compliant float and double. However, allow platforms with no denorms, no infinity and no NaN. 2. Preserve signbit of zero, inifinty and Nan when serializing and deserializing. 3. Do not preserve the exact bit pattern of NaN. (That would be pointless, because a bit pattern that is a quiet Nan on one platform may be a signaling Nan on another platform.) 4. Replace denorms by 0 when deserializing denorms on platforms with no denorms. 5. Throw exception when deserializing infinity and Nan on platforms with no infinity and NaN. 6. Do not support long double at all. There exists a jungle of different long double formats. Any comments on this? --Johan Råde