www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3653] New: Problem sorting array of Rebindable

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: peng2cheng2 yahoo.com


--- Comment #0 from pc <peng2cheng2 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: -------
Dec 26 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3653



--- Comment #1 from pc <peng2cheng2 yahoo.com> 2009-12-26 15:14:42 PST ---
(From update of attachment 535)
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..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 26 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3653


Shin Fujishiro <rsinfu gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |rsinfu gmail.com
         AssignedTo|nobody puremagic.com        |rsinfu gmail.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 24 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3653


Shin Fujishiro <rsinfu gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Shin Fujishiro <rsinfu gmail.com> 2010-05-26 02:57:50 PDT
---
Fixed in svn r1554. Thanks for the patch! (or hack ;-))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 26 2010