[Issue 3653] New: Problem sorting array of Rebindable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 26 15:11:04 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3653
Summary: Problem sorting array of Rebindable
Product: D
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: peng2cheng2 at yahoo.com
--- Comment #0 from pc <peng2cheng2 at yahoo.com> 2009-12-26 15:11:02 PST ---
Created an attachment (id=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());
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list