[Issue 5282] Optimize array comparison which use memcmp to something better and remove unnecessary indirections.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 29 03:31:06 PST 2010


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



--- Comment #6 from Stewart Gordon <smjg at iname.com> 2010-11-29 03:29:34 PST ---
(In reply to comment #3)
> The conditions for memcmp working as a way of comparing structs are:
> 
> - no opEquals of a compatible parameter type
> - no holes due to alignment
> - no members with reference semantics (dynamic arrays, AAs, classes)
> - all of this applies recursively to any struct or union members

Looks like I was wrong....
http://www.digitalmars.com/d/1.0/expression.html#CmpExpression
"Equality for struct objects means the bit patterns of the objects match
exactly (the existence of alignment holes in the objects is accounted for,
usually by setting them all to 0 upon initialization)."

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