On Sunday, 22 February 2015 at 09:59:36 UTC, ponce wrote:
On Sunday, 22 February 2015 at 02:27:30 UTC, Peter Alexander wrote:
On Sunday, 22 February 2015 at 01:24:09 UTC, Almighty Bob wrote:

are semantically equivalent to:

a = cast(typeof(a))(a op b)

Seems questionable to me. Anyone know the rationale? If a = b; is disallowed, I don't see why a += b; should be more acceptable.

Questionable or not, this is the C behaviour we might not depart from.

D has already departed from C,

int a;
float b;
a = b;
a = a+b;
a += b;

All 3 are valid in C, but only the later is valid in D.

But at least with MSVC you can get warnings when you do such things.

Reply via email to