Error: array operation d1[] + d2[] without assignment not implemented
deed via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Sep 13 09:25:29 PDT 2014
> Hi!
>
> struct Vector (T)
> {
> T[]arr;
> T[] opSlice() { return arr; }
> }
> Vector!double v;
> double[] d;
> v[][] = d[] + d[];
>
> //first [] call opSlise, second [] for array syntax
>
> Best Regards,
> Ilya
Thanks for your suggestion. It's not as attractive though, it
would be the same as v.arr[] = ..., exposing the naked array. The
syntax also becomes a bit confusing.
With alias this it works, but functionality is lost. See
http://dpaste.dzfl.pl/35081c1f1745
It feels not consistent, so I guess that's the reason for the
"not implemented" message.
More information about the Digitalmars-d-learn
mailing list