http://d.puremagic.com/issues/show_bug.cgi?id=5519
--- Comment #2 from Denis Derman denis.s...@gmail.com 2011-02-03 03:40:07 PST
---
(In reply to comment #0)
Surprisingly this works (DMD 2.051):
struct Bar {
int x;
const bool opEquals(ref const(Bar) o) {
return x ==
http://d.puremagic.com/issues/show_bug.cgi?id=5519
--- Comment #3 from Denis Derman denis.s...@gmail.com 2011-02-03 03:55:37 PST
---
The core issue, I guess, is that '==' implicitely means comparison by value
equality. This sense is even more obvious in D which has a dedicated operator
'is'
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 {
...