Am 21.01.2012, 05:28 Uhr, schrieb Kapps <ka...@notvalidemail.com>:

This issue left me with a permanent avoidance of ref foreach after encountering it the first day I used D.

On 20/01/2012 10:25 PM, Andrej Mitrovic wrote:
One of the first bugs I've filed (now 1.5+ years old):

void main()
{
     float[] arr = [1.0, 2.5, 4.0];
     foreach (ref double elem; arr) {
         elem /= 2;
     }
     writeln(arr);  // still [1, 2.5, 4]
}

Issue 4510

That's a harsh decision, when you can have correct and shorter code by removing the word "double". The bug report is of course still well deserved.

Reply via email to