Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-09-21 09:16:57

Hartmut Kaiser wrote:
>>>> Aristid Breitkreuz <aribrei_at_[hidden]> writes:
>>>>> You can't assume short is 16-bits (but that's more or
>> less academic).
>>>> Academic or no, I'd love to hear your reasoning on that one.
>>> The standard is clear that short must be /at least/ 16 bits
>> Okay, that's all I needed to hear, thanks.
> Actually that's not correct. The Standard is quite clear when it
> states []:
> There are four signed integer types: "signed char", "short int",
> "int", and "long int." In this
> list, each type provides at least as much storage as those preceding
> it in the list.
> And []:
> For each of the signed integer types, there exists a corresponding
> (but different) unsigned integer type:
> "unsigned char", "unsigned short int", "unsigned int", and "unsigned
> long int," each of which occupies the same amount of storage and has
> the same alignment requirements (3.9) as the corresponding signed
> integer type)

You need the C standard to get the complete picture; it states that
USHRT_MAX is at least 65535.

Boost list run by bdawes at, gregod at, cpdaniel at, john at