ref Element opIndexAssign( in Element a, in uint n )
{
data[n] += a;
return data[n];
}

I'm guessing as I don't use 2.0 but I think that this is a bug. DMD is trying to say that the above returns are trying to return something that can't be referenced (like a math expression result).


It is a bug, indeed. The struct 'invariant' prevents proper template instantiation somehow... Removing it makes code work as intended.
I'll submit a bug report.

Thank you!

Give a link to the bugreport later?

Reply via email to