|
by Eric Lippert via Fabulous Adventures In Coding on 4/1/2011 8:06:00 AM
Last time I discussed how the compound assignment operators of the form “x op= y” have some perhaps unobvious behaviours in C#, namely:
(1) though logically this is expanded as “x = x op y”, x is only evaluated once(2) for built-in operators, if necessary, a cast is inserted, so that this is analyzed as “x = (T)(x op y)” (3) for built-in operators, if “x = y” would be illegal then so is “x op= y”
I am pleased to announce that we are at
... [ read more ]
|
|