[Issue 2282] New: Struct copy-constructor should call opAssign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 14 07:56:13 PDT 2008


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

           Summary: Struct copy-constructor should call opAssign
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: 2korden at gmail.com


opAssign isn't called upon copy-construction.

I think that the following:

struct Test {
    void opAssign(Test other) {
       // ...
    }
    // ...
}

Test t1;
Test t2 = t1;

should be translated into the following:

Test t1;
Test t2 = void;
t2 = t1;


-- 



More information about the Digitalmars-d-bugs mailing list