[Issue 10960] Copying a const value type should yield unqual

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 3 16:56:07 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10960



--- Comment #2 from hsteoh at quickfur.ath.cx 2013-09-03 16:56:05 PDT ---
Oh I see. I misunderstood your question, my bad. :)

Nevertheless, both issues are worth consideration. The unqual issue should be
fixed, definitely.

About your actual question: I'm not so sure this is possible, although in
theory, it *could* be made possible if B's elements are rebindable. So in
theory, this should work:

    class C { ... }
    auto A = [0, 1, 2];
    const B = [new C(1), new C(2), new C(3)];
    schwartzSort!(i => B[i])(A);

The idea being that schwartzSort stores an array of rebindable references to
the C instances, and uses that to sort A. This probably doesn't work right now
because the language currently has no way to express tail-const in class
references, though I'm guessing that if you use Rebindable!C, it should work.

-- 
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