3 ms·
"When the return value is needed, the Swift += operator cannot be used in-line, since (unlike C) it returns Void." Why was this decision made?
by bootload 11y ago
"When the return value is needed, the Swift += operator cannot be used in-line, since (unlike C) it returns Void."
Why was this decision made?
- legulere 11y agoSo you can't do this: a += b -= c; Don't ask me in which order it executes, I would need to read the C standard again and wrap my head around how this case is described therein. I'm also not sure wether this is defined or undefined behaviour: a += b -= c *= a;
- JoeAltmaier 11y agoNow throw a few ++ and -- in there, and boy howdy.
- bootload 11y ago"So you can't do this: a += b -= c; Don't ask me in which order it executes," thx for the reply @legulere, I can now see the void, why would the language allow syntax that smells so bad? Can you do this in "c"?