"++" vs "+=" on function parameter

Nick Treleaven nick at geany.org
Sun Mar 8 12:42:19 UTC 2026


On Sunday, 8 March 2026 at 10:26:54 UTC, claptrap wrote:
> Doesnt that mean "p++" is inconsistent? Arn't "p++" and "p+=1" 
> essentially shorthand for "p=p+1"

 From https://dlang.org/spec/expression.html#order-increment:

```d
Expression	Equivalent
++expr		((expr) += 1)
expr++		(ref x){auto t = x; ++x; return t;}(expr)
```


More information about the Digitalmars-d mailing list