Summary: [qtd] AA element assignment should use
                    copy-constructor to initialize new elements
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Max Samukha <> 2010-11-18 08:23:00 
PST ---
Currently opAssign is called on newly created AA elements of struct types. This
leaves us absolutely no possibility to properly initialize AA elements without
introducing costly and unreliable checks in opAssign:

struct QString
    ref QString opAssign(ref QString other)
        if (memcmp(cast(void*)&this, cast(void*)&T.init, sizeof(this)) == 0)
            // construct copy
            // assign

QString[int] ss;
QString s = qs("some string");
ss[0] = s;

Can AA be modified so that new elements are initialized with the
copy-constructor (as they should be) and not opAssign?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to