Created attachment 535
short test of arrays of Rebindable
Digital Mars D Compiler v2.037
/* The following did not compile. Error deep in phobos due to the line
starting with "sort". (comment it out, and no problem).
*/
import std.traits;
import std.stdio, std.algorithm;
class C1 { int x; this(int x){this.x = x;} int y() const { return x; } }
alias Rebindable!(const(C1)) RC1;
void test3() {
RC1[] aCs;
aCs.length = 2;
aCs[0] = new C1(9);
aCs[1] = new C1(10);
aCs ~= RC1(new C1(8));
sort!("a.x < b.x")(aCs); //compiles only after hack (see attached file)
foreach(ac; aCs)
writeln(ac.y());
}
Comment #1 by peng2cheng2 — 2009-12-26T15:14:42Z
Comment on attachment 535
short test of arrays of Rebindable
Note: to make this compile without the hack in the attached file, one would have to import std.typecons as well as commenting out the sort line..
Comment #2 by rsinfu — 2010-05-26T02:57:50Z
Fixed in svn r1554. Thanks for the patch! (or hack ;-))