Can't use float array in map

Andrej Mitrovic none at none.none
Fri Jun 3 09:59:29 PDT 2011


test case:

import std.algorithm;

void main()
{
    float[10] arr;
    arr[] = 0.0;
    map!((ref float sample){ sample = 1.0; })(arr[]);
}

D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(382): Error: nan is not an lvalue

This looks like a bug to me?


More information about the Digitalmars-d-learn mailing list