Flatten a range of static arrays

Dennis dkorpel at gmail.com
Fri Feb 7 22:55:29 UTC 2020


On Friday, 7 February 2020 at 21:40:36 UTC, Steven Schveighoffer 
wrote:
> S.popFront is not @safe, and S is not a template. So no 
> inferrence.

Oops, minimized a bit too much. Corrected test case:
```
import std;

struct S {
@safe:
      int[3] front = [10, 20, 30];
      bool empty = false;
      void popFront() {empty = true;}
}

void main() @safe {
      S.init.map!((return ref x) => x[]).joiner.writeln;
}
```
It indeed still errors with -dip1000, but without -dip1000 it 
compiles now interestingly.


More information about the Digitalmars-d-learn mailing list