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

           Summary: OpAssign is not called when this(this) is disabled
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: deadal...@gmail.com


--- Comment #0 from deadalnix <deadal...@gmail.com> 2011-11-29 13:16:21 PST ---
As of
http://digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=150299

If we disable this(this) in a struct, the opAssign member function should be
used if it exists. Here is a sample code :

module fail2;

struct Fail {
    @disable
    this(this);

    ref Fail opAssign(ref const Fail t) {
        return this;
    }
}

int main(string[] argv) {
    Fail a;
    Fail b = a; // Error: struct fail2.Fail is not copyable because it is
annotated with @disable

    return 0;
}

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

Reply via email to