http://d.puremagic.com/issues/show_bug.cgi?id=1309
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution| |FIXED --- Comment #8 from Kenji Hara <[email protected]> 2011-04-12 02:36:01 PDT --- On trunk dmd, this code works. ---- import std.stdio; import std.random; struct MyStruct { uint field; //int opCmp(MyStruct* m) int opCmp(ref const(MyStruct) m) const { writeln("This is opCmp"); return field - m.field; } } void main() { MyStruct[] structs; for(int i=0;i<50;i++) structs ~= MyStruct(50-i); structs.sort; foreach(s;structs) writeln(s.field); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
