Boost logo

Boost :

Subject: Re: [boost] [endian] Some suggestions
From: Thijs van den Berg (thijs_at_[hidden])
Date: 2016-04-12 10:27:54


On 12 April 2016 at 16:04, Peter Dimov <lists_at_[hidden]> wrote:

> Thijs van den Berg wrote:
>
>> There are two type of interoperability IMO:
>> 1) a single program read and writes bytes to memory or disk
>> 2) two different compilations of a program that run on (an have been
>> compiled for) different machines and which want to exchange floats via some
>> form of serialisation.
>>
>> From what I've understood the scope of the endian library is to support
>> 1),
>>
>
> That would be a bit odd, because I'm not sure that you need a library for
> 1) at all. The endianness can't differ within the same program.
>
good point, like SUN, right? IMO the library should be able to handle that
*or* make it clear what platforms it supports. and which ones not.

I wouldn't however expect the library to do any representation conversions
other that the primitive operations regarding the byte order inside words.

If "numerical representation conversion" was included in the scope then one
would perhaps name the library differently? (I like libraries to have
understandable names). I can imagine that not all number mappings are
bijective, so that would be a complex library that require policies,
inspection etc. To me it feels that if you go that way, then it'll be more
about serialisation, .. would you later also add byte counted string to
that library? Or would the scope be limited to numerical hardware
represenations (floats/ints)?


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