Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-30 09:19:27


Matthias Troyer <troyer_at_[hidden]> writes:

> On Saturday, November 30, 2002, at 02:06 AM, David Abrahams wrote:
>
>> Matthias Troyer <troyer_at_[hidden]> writes:
>>> In any case the library user should be reminded that short, int and
>>> long are never portable
>>
>> Of course they are perfectly portable!
>
> I don't understand how you mean that.

I mean that all those types exist on all C++ compilers and satisfy the
minimum guarantees given by the standard.

> If sizeof(long) on one platform id larger than sizeof(long) on
> another platform, then not all numbers serialized from a long on the
> one machine can be read on the other.

If you are writing code you expect to be portable, it's your
responsibility to ensure that longs don't store numbers which require
more than 32 bits, 1s complement.

-Dave

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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