My Kingdom For ...

Janice Caron caron800 at googlemail.com
Sun Feb 24 00:39:43 PST 2008


On 24/02/2008, Janice Caron <caron800 at googlemail.com> wrote:
> I think it would be better if widening type promotions were not done
>  where not necessary.

"where not necessary" now becomes the problem. When is it necessary?

    ubyte n = 255;
    auto m = n + 2;

what type is m?

    uint x = 0xFFFFFFFF;
    auto y = x + 2;

what type is y?

These things obviously need clearly defined rules. Currently the rules
seem to be, if in doubt, use int. I don't know if that's necessarily
correct in all cases.



More information about the Digitalmars-d mailing list