Why isn't == used to compare structs

Don nospam at nospam.com
Tue Feb 9 13:27:48 PST 2010


Trass3r wrote:
>>>  Structs are compared *bitwise*!
>>
>> Not in D2, any more. If a member has an opEquals, it's compared using ==.
> 
> Ok, what's the rationale?

If there is an opEquals, it should not be ignored. If it has no 
opEquals, it's just considered to be a bag of bits.


More information about the Digitalmars-d-learn mailing list