Warning: explicit element-wise assignment (this.vector)[] = vec.vector[cast(ulong)0..cast(ulong)dimension]

Ali Çehreli acehreli at yahoo.com
Mon Jun 24 14:17:35 PDT 2013


On 06/24/2013 12:17 PM, David wrote:

 > The problem is, I wrote this code on purpose and I *want* it to work
 > like that, and I evenn need it to work like that (a few lines above in
 > "construct"), but this currently blocks gl3n from beeing updated for 
Fedora.

You are right because 'vector' is a fixed-length array. So, the 
following two have the same effect:

     vector = vec.vector[0..dimension];

     vector[] = vec.vector[0..dimension];

I don't know whether that is by design. One can argue that array-wise 
syntax should be recommended only for slices.

In any case, as bearophile says, uniformity is always helpful.

Ali



More information about the Digitalmars-d-learn mailing list