On Tuesday, 30 January 2024 at 15:38:26 UTC, Paul Backus wrote:
This definitely isn't allowed in C or C++. I wonder what the rationale is for having this behavior in D?
It isn't allowed in C, but allowed in C++ https://godbolt.org/z/9xTPhsb5GAs for rationale... I don't know why it wouldn't be allowed? You clearly need an lvalue to use prefix ++, and the result is the value after adding one, so why can't it be bound to a reference? I don't see where the problem would arise.
-Steve