On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote:
[1] https://github.com/dlang/DIPs/pull/129

Thanks for making the DIP. I can't get this code to compile (my struct has an `int i` field):

static foreach (i, ref field; src.tupleof)
    this.tupleof[i] = field;

Error: constant value src.i cannot be ref

https://run.dlang.io/is/qeugC8

Removing `static` works. Otherwise I tried changing `ref` to `alias`:

Error: variable src cannot be read at compile time

But this shorter code seems to work fine:

this.tupleof = src.tupleof;

Reply via email to