Summary: structs should allow calling the normal blitting
                    function when overriding opAssign
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]

In D1, if I overload opAssign in a struct, I cannot create an overload that
takes the struct as an argument.  This is marked as illegal.

However, in a recent version of D2 (not sure which one), this became legal. 
However it has a bad side effect.  If I want to overload opAssign for an
argument other than the struct, for example an int, then it masks the overload
that just does the blitting.  I have to re-implement the blitting version.

I understand that an author may want to control opAssign to the point of
disallowing simple blitting copy.  But if desired, it is a PITA to do the
blitting manually.  It would be nice to be able to alias the original function,
or flag the struct somehow so that the compiler will use the blitting function
when assigning one struct to another.


Reply via email to