import std.stdio;
import std.container;
class TestClass {
this(int v_) {
v = v_;
}
int v;
}
void main() {
auto rb = redBlackTree!(TestClass *)();
TestClass c1 = new TestClass(1);
TestClass c2 = new TestClass(2);
rb.insert(c1);
rb.insert(c2);
foreach (TestClass *t; rb)
writeln(t.v);
}
CmltcG9ydCBzdGQuc3RkaW87CmltcG9ydCBzdGQuY29udGFpbmVyOwoKY2xhc3MgVGVzdENsYXNzIHsKCXRoaXMoaW50IHZfKSB7CgkJdiA9IHZfOwoJfQoJaW50IHY7Cn0KCnZvaWQgbWFpbigpIHsKCglhdXRvIHJiID0gcmVkQmxhY2tUcmVlIShUZXN0Q2xhc3MgKikoKTsKCVRlc3RDbGFzcyBjMSA9IG5ldyBUZXN0Q2xhc3MoMSk7CglUZXN0Q2xhc3MgYzIgPSBuZXcgVGVzdENsYXNzKDIpOwoKCXJiLmluc2VydChjMSk7CglyYi5pbnNlcnQoYzIpOwoKCWZvcmVhY2ggKFRlc3RDbGFzcyAqdDsgcmIpCgkJd3JpdGVsbih0LnYpOwp9
prog.d:18: error: template std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert cannot deduce function from argument types !()(TestClass), candidates are:
/usr/include/d/4.9/std/container.d:5955: note: std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, Elem))
/usr/include/d/4.9/std/container.d:5974: note: std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem))
prog.d:19: error: template std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert cannot deduce function from argument types !()(TestClass), candidates are:
/usr/include/d/4.9/std/container.d:5955: note: std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, Elem))
/usr/include/d/4.9/std/container.d:5974: note: std.container.RedBlackTree!(TestClass*).RedBlackTree.stableInsert(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem))