http://d.puremagic.com/issues/show_bug.cgi?id=5519
--- Comment #4 from Denis Derman <denis.s...@gmail.com> 2011-02-03 04:30:32 PST --- One (hopefully last) more point: A situation where one may constantly need to compare structs for equality (by value!) is unittests: unittest { ... assert (result == S(a, b)); } This is actually how I stepped on the present issue. The general workaround is indeed to write custom opEquals methods which just compare member per member. Thus, I ended up adding such opEquals to all structs: struct Lexeme { string tag; string slice; Ordinal index; // for parser match error messages string toString () { return format(`Lexeme("%s","%s",%s)`, tag,slice,index); } // workaround for bug in default struct '==' const bool opEquals (ref const(Lexeme) l) { return ( this.tag == l.tag && this.slice == l.slice && this.index == l.index ); } } Denis -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------