[Issue 3789] Structs members that require non-bitwise comparison not correctly compared

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 26 08:07:08 PDT 2012


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



--- Comment #17 from Simen Kjaeraas <simen.kjaras at gmail.com> 2012-03-26 08:07:29 PDT ---
To further underline this point:

struct S {
    string x;
    bool opEquals(const ref S other) const {
        return x == x;
    }
}

struct T {
    S s;
    string r;
}

void main() {
    T t1, t2;
    t1.s.x = "foobar".idup;
    t1.r = "foobaz".idup;
    t2.s.x = "foobar".idup;
    t2.r = "foobaz".idup;
    assert(t1 == t2);
}

Yes, the string values in r are compared not bitwise, but for content.

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