static array is not a range

Alexibu alex at sunopti.com
Tue Jan 9 10:11:35 UTC 2024


It looks like isInputRange is false for arrays with fixed length 
by design.

I can do:

```d
float[4] arr;
foreach(x;arr)
    writefln("%s",x)
```
but not :

```d
arr.each!(a => a.writefln("%s",a));
```
Is there a good reason for this ?
It took my a long time to figure out.


More information about the Digitalmars-d-learn mailing list