[Issue 6906] Cannot assign value into associative array if contains opAssign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 8 07:16:41 PST 2011


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


Jesse Phillips <Jesse.K.Phillips+D at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jesse.K.Phillips+D at gmail.co
                   |                            |m


--- Comment #2 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2011-11-08 07:16:04 PST ---
Can I then say you aren't able to define opAssign for a struct and have it work
for associative arrays:

    void main() {
       S[string] ss;
       S s;

       ss["hello"] = s;
    }

    struct S {
       void opAssign(int i) {
       }
       void opAssign(S s) {
           this = s;
       }
    }

/tmp$ ./test
Segmentation fault

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