http://d.puremagic.com/issues/show_bug.cgi?id=874
Don <clugd...@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugd...@yahoo.com.au --- Comment #2 from Don <clugd...@yahoo.com.au> 2009-08-12 06:17:48 PDT --- The equivalent code (below) works correctly on D2. This is a D1-only bug. --------- import std.stdio; template AA(V, K) { V[K] AA(T...)(T args) { V[K] ret; K key; foreach(i, arg; args) { static if(!(i & 1)) key = arg; else ret[key] = arg; } return ret; } } void main() { string[string] array = AA!(string, string)("a", "b"[], "c"[], "d"[]); writefln("length = %d\n", array.length); foreach(k, v; array) writefln("array[%d]=%s", k, v); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------