Is there any reason why arithmetic operation on shorts and bytes return int?

Peter Alexander peter.alexander.au at gmail.com
Tue Dec 11 05:35:45 PST 2012


On Tuesday, 11 December 2012 at 13:24:59 UTC, d coder wrote:

> But it does not look clean if you have to write:
>
> byte a, b, c;
> a = cast(byte) (b + c);

That's the whole point. What you are doing is dangerous, so it 
requires the cast.

Adding a compiler flag to change the semantics of the language 
sounds like a recipe for disaster.



More information about the Digitalmars-d mailing list