Comment #0 by ellery-newcomer — 2011-08-11T19:01:44Z
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)
Comment #1 by issues.dlang — 2011-08-11T21:05:21Z
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.