Bug 3653 – Problem sorting array of Rebindable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2009-12-26T15:11:00Z
Last change time
2015-06-09T01:28:18Z
Assigned to
rsinfu
Creator
peng2cheng2

Attachments

IDFilenameSummaryContent-TypeSize
535rebind_dos.dshort test of arrays of Rebindabletext/x-dsrc2253

Comments

Comment #0 by peng2cheng2 — 2009-12-26T15:11:02Z
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 ;-))