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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Dec 11 09:04:45 PST 2012


On 12/11/12 11:36 AM, d coder wrote:
> Thanks Everybody for responding. I have another query which is off-topic
> but related.
>
> Why is the following allowed in D?
>
> long a;
> int b;
>
> b += a; // Allowed -- no explicit cast

RMW operations are allowed without a cast.

Andrei


More information about the Digitalmars-d mailing list