cat > bug.d << CODE struct Foo { string name; bool b; } void main() { auto a = Foo("foobar".idup, true); auto b = Foo("foobar".idup, true); assert(a == b); } CODE dmd -run bug -------- The structures are compared bitwise which fails here.
I think this is just same as bug 3789.
In the absense of a user-defined opEquals for the struct, equality is defined as a bitwise compare. This is working as expected. Not a bug.
(In reply to comment #2) > In the absense of a user-defined opEquals for the struct, equality is defined > as a bitwise compare. This is working as expected. Not a bug. See my answer in Bug 3789 .
I didn't found the specs. http://dlang.org/expression.html#EqualExpression