> On 3/22/12, H. S. Teoh <hst...@quickfur.ath.cx> wrote: > snip
Hmm, what about (temporary) compatibility with hash literals? You could add the following to the newAA module: static import std.traits; template KeyType(V : V[K], K) { alias K KeyType; } template ValueType(V : V[K], K) { alias V ValueType; } and in the AssociativeArray struct: void opAssign(AA)(AA aa) if (std.traits.isAssociativeArray!AA && is(KeyType!AA == keytype) && is(ValueType!AA == valuetype)) { foreach (key, val; aa) this[key] = val; } Then this will work: AA!(int, string) intToStr; intToStr = [1:"foo"]; assert(intToStr[1] == "foo"); Otherwise it will be pretty hard to test the new hashes without changing a significant amount of code.