Tuple [] operator

Christian Manning cmanning999 at gmail.com
Mon Aug 8 12:27:06 PDT 2011


Hi,
I'm receiving this error with dmd 2.054:
"tmp.d(7): Error: no [] operator overload for type Tuple!(int,short)" for 
the following test case

import std.typecons;
void main() {
auto x = 1;
Tuple!(int,short) a;
a[0] = 1;
a[x] = 2;
}

If I use a value instead of a variable ie. a[1] = 2; it compiles fine.

A search turned up http://d.puremagic.com/issues/show_bug.cgi?id=6273 and 
http://d.puremagic.com/issues/show_bug.cgi?id=6342 though they specifically 
mention the use of pure functions which I'm not using. Is this the same 
problem anyway?

Chris


More information about the Digitalmars-d-learn mailing list