Summary: comparing a struct with an array member does a bitwise
           Product: D
           Version: 2.040
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Steven Schveighoffer <> 2010-02-09 
12:08:23 PST ---
If you have a struct that does not define opEquals, but which contains a member
that defines opEquals, that member's opEquals is called when comparing the

However, arrays are still bitwise compared.  Example:

struct String
    char[] data;

void main ()
    auto foo = String("foo".dup);
    auto bar = String("foo".dup);

    assert( ==;
    assert(bar == foo, "oops structs aren't equal");

results in the second assert failing.

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

Reply via email to