compare struct with string member is wield;

Cheng Wei rivercheng at gmail.com
Tue Oct 11 22:16:40 PDT 2011


struct S {
  string str;
};

S g_s;

unittest {
    S s1;
    S s2;
    assert(s1 == s2);         // Success
    assert(g_s == s1);        // Failed
}

Is this expected? If so, may I know the reason? Thanks.


More information about the Digitalmars-d-learn mailing list