tuple can write [],but can't read []

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 29 02:45:58 PDT 2014


Andrea Fontana:

> If I'm right, index should be a compile-time value.

Right. Because tuples in general don't contain N values of the 
same type (as in your case), so the compiler has to know 
statically the index to compute their position efficiently.

Further similar questions are better asked in D.learn.

I also suggest to not mix tab and spaces to indent code, 
configure your editor to use only spaces or only tabs (4 spaces 
is the D standard).

Bye,
bearophile


More information about the Digitalmars-d mailing list