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: [email protected]
Reporter: [email protected]
Didn't find an existing issue for this. Sorry, if missed.
As described here:
https://forum.dlang.org/post/[email protected]
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);
--