[Issue 4424] Copy constructor and templated opAssign cannot coexist

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 28 12:57:27 PDT 2011


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



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2011-04-28 12:53:39 PDT ---
Created an attachment (id=955)
test cases

Patch created:
https://github.com/9rnsr/dmd/compare/master...fix4424

Behaviors:
- if template opAssign exists, check it is identity opAssign.
- if template identity opAssign need, following opAsign build:
    ref S opAsign(T:S)(T s) if (is(T == S))
    {
      T tmp = this;   // bit copy
      this = s;       // bit copy
      tmp.dtor();
      return this;
    }
- no changes with non tempate opAssign.

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