DIP 1022---foreach auto ref---Community Review Round 2

Walter Bright newshound2 at digitalmars.com
Sun Oct 20 08:32:57 UTC 2019

I find the Rationale section to be completely confusing as to:

1. what the existing state of the compiler is
2. what the proposed change is

For example,

"A pull request[3] was submitted to disallow this behavior."

That PR was merged, although the Rationale implies it was not.

Further, that PR appears to disallow ref being applied to temporaries, yet the 
prose goes on to imply it does:

"If a range with non-reference semantics is accidently passed to such a loop, it 
will be iterated by value, which is likely to be unexpected."

The "A simple example" is not simple at all, because it imports std.range:iota 
and is not possible to understand without examining the source to iota.

More information about the Digitalmars-d mailing list