Any reason why ++1 is not folded to a new constant?

mw mingwu at gmail.com
Thu Oct 22 03:41:56 UTC 2020


On Wednesday, 21 October 2020 at 21:49:11 UTC, Walter Bright 
wrote:
> Because ++ is supposed to operate on an lvalue, and `1` is an 
> rvalue. `++1` is nonsense.
>
> I don't see the point to adding a special case for it - special 
> cases are warts and need strong justifications to add.

👍, well said.

I hope every D language feature has no special cases.




More information about the Digitalmars-d mailing list