AssociativeArray!(K,V) .init has no [] operator
Philippe Sigaud
philippe.sigaud at gmail.com
Sun Mar 14 07:50:24 PDT 2010
There has been lots of AssociativeArray-related bugs recently. I'm not sure this one has been reported, I tried to find it in bugzilla, with no success.
auto aa = (int[int]).init;
aa[3] = 2; // Error, no [] operator overload for type AssociativeArray!(int,int)
whereas this works, obviously:
int[int] aa;
aa[3] = 2;
I use .init a lot in template constraints, as std.algo or .range does. Do other people here do that also?
Philippe
More information about the Digitalmars-d
mailing list