Boost logo

Boost :

Subject: Re: [boost] Candidate for 1.66.1, if there is one
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-12-24 18:10:54


On 12/24/17 9:04 AM, Peter Dimov via Boost wrote:
> James E. King, III wrote:
>
>> This leads me to wonder if serialization is compatible across
>> platforms and if it is *supposed *to be compatible across platforms.
>> Is this a bug?? Shouldn't binary serialization be the same size on
>> every platform, assuming platform-specific types are not used?
>
> As far as I know, the built-in binary archives are completely
> platform-dependent, in both size and endianness.

Correct. Only text base archives are guarenteed to be portable across
platforms, times, versions and whatever.

> It should be possible to create portable ones based on Endian's buffer
> types, one just needs to choose an appropriate size for 'int' (32 bits
> would probably be fine here) and 'long' (32, 48, or 64? hard to say.)

Look at the potable archive example in examples and documentation. It's
all there. But it's based on a better idea than the above one.

Robert Ramey


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