Why there is too many uneccessary casts?

Temtaime temtaime at gmail.com
Tue Jun 11 04:46:11 PDT 2013


No. I means, that

uint a = uint.max;
uint b = a + 1;
writeln(b);

Works OK.
Why? Compiler doesn't know if a + b fits in uint, right?
Then why overflow with ints are accepted?

So your example is meaningless.


More information about the Digitalmars-d-learn mailing list