short s, t; t = -s: no (longer) works: Deprecation: integral promotion not done for -s, use

kdevel kdevel at vogtner.de
Sat Feb 24 22:57:08 UTC 2018


On Saturday, 24 February 2018 at 22:30:09 UTC, Steven 
Schveighoffer wrote:

> The prime example is this:
>
> byte b = -128;
>
> int x = -b;
>
> What would you expect x to be?
>
> a) 128
> b) -128

Neither nor. I would prefer the codomain of "-" be the range of 
byte
and hence an exception thrown in that case.


More information about the Digitalmars-d-learn mailing list