Regarding a vector op

bearophile bearophileHUGS at lycos.com
Tue May 21 17:12:45 PDT 2013


Currently this code doesn't compile:

void main() {
     int[2] data = [10, 20];
     double[2] result;
     result[] = data[] * 0.5;
}


It gives the error:
test.d(4): Error: incompatible types for ((data[]) * (0.5)): 
'int[]' and 'double'

Is code like this meant to work?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list