Re: When do I need to override hash?
Re: When do I need to override hash?
- Subject: Re: When do I need to override hash?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 21 Aug 2009 11:20:52 +0200
No, not true.
Key values cannot be mutated while used in a collection, period.
Correct.
Excuse my intrusion in this discussion, but I don't really
understand why 'isEqual:' and 'compare:' results must not change
when an object is used as key.
My though was that as long as the hash remain the same, it should
not be an issue. I don't see any case where it may be useful, but
don't see why it would be illegal ?
Forget my question, I just see this comment from Quincey which give me
an answer.
[Actually, for all I know, key values *can* be mutated while used in a
collection, provided the hash value doesn't change, but even if it
technically feasible it sounds so un-useful I'd argue it's better just
to assert that it's not allowed.]
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden