[Issue 15792] New: Error Filling an array
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Mar 12 08:14:53 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15792
          Issue ID: 15792
           Summary: Error Filling an array
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: sascha.orlov at gmail.com
Didn't find an existing issue for this. Sorry, if missed.
As described here: 
https://forum.dlang.org/post/iizchhylkxistlnbijzd@forum.dlang.org
There is an error during an attempt to fill an array of Nullable!uint during
the execution of
void main()
{
    import std.typecons;
    Nullable!uint[] arr;
    arr.length = 5;
    arr[] = 1;
}
The suggested workaround is, currently, using a cast:
arr[] = cast(Nullable!uint)1;
Also an option would be: 
import std.algorithm;
fill(arr, 1);
--
    
    
More information about the Digitalmars-d-bugs
mailing list