Dynamic arrays allocation size

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Mar 26 11:48:27 PDT 2013


On 3/26/13 1:56 PM, "Luís Marques" <luismarques at gmail.com>" wrote:
> BTW, as far as I can see the overflow/underflow behavior never got
> specified by the language, in any case:
>
> 1) http://forum.dlang.org/thread/jo2c0a$31hh$1@digitalmars.com <-- no
> conclusion
>
> 2) Andrei's book doesn't seem to mention the topic.
>
> If it is specified somewhere please do tell. Whatever the behavior
> should be (unspecified, modulus for unsigned integers, etc) there really
> should be an official stance.

D obeys two's complement overflow rules for its signed and unsigned 
arithmetic. TDPL defines a checked integer type as an example of 
operator overloading.

Andrei


More information about the Digitalmars-d mailing list