dmd32 2.054 the code: import std.container; void main(){ auto t = make!(RedBlackTree!(string)); t.insert(["1","2","3"]); t.removeKey("1"); } the fireworks: error9.d(10): Error: template std.container.RedBlackTree!(string).RedBlackTree.removeKey(U) if (isImplicitlyConvertible!(U,Elem)) does not match any function template declaration error9.d(10): Error: template std.container.RedBlackTree!(string).RedBlackTree.removeKey(U) if (isImplicitlyConvertible!(U,Elem)) cannot deduce template function from argument types !()(string)
t.removeKey!string("1"); I believe that this is a case of template inferrence failing, because it's deciding that the input to removeKey is a range a dchars rather than a single string, and you can't covert dchar to the element type of the container (string), and so compilation fails. I don't know how fixable it is with template constraints. Hopefully someone can sort it out, but it may be that the compiler is just too stupid in this case.
https://github.com/D-Programming-Language/phobos/pull/363
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/da2cf56892606fa81624f30dbbff3d2dbe77508b Merge pull request #363 from jmdavis/redblacktree Fix for Bug #6472. Make RedBlackTree's removeKey work with strings.