Filling an array

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 12 10:33:16 PST 2016


On Saturday, 12 March 2016 at 16:37:25 UTC, user42 wrote:
> On Saturday, 12 March 2016 at 14:33:19 UTC, Alex wrote:
>> /snip
>
> I thought this was supposed to halt with an error rather than 
> compile and set all members to 1.
> The syntax, to me anyways, doesn't really communicate the 
> intention of: set all members to 1.
>>     //arr[] = 1;
>
> Whereas the following does
>>     fill(arr, 1);

Well, this was not the question. As stated here:
https://dlang.org/spec/arrays.html
in the section "array setting", it is possible to set an array in 
such a manner. And my question was, why a specific array behaves 
not as expected.
So, either there is a problem with filling an array, or, there is 
a problem with implicit conversion of a Nullable!T to its 
underlying type.


More information about the Digitalmars-d-learn mailing list