> Am 15.07.2016 um 15:19 schrieb Shawn Erickson <[email protected]>:
> 
> Additional two "things" maybe considered equal in the chosen problem domain 
> despite their identity (memory location, etc.) being different. Having the 
> ability to supply custom hash and equality for types can be a useful tool in 
> a developers toolbox. For example two pathways of code may create what is 
> actually the same thing (say a reference to the same file on disk) then want 
> to work with stdlib set and/or dictionary with the equivalent things being 
> resolved correctly, etc.
> 
> To remove custom equality will limit some designs and to force identity based 
> equality with present similar problems on the other end of the spectrum.

It is only for value types. For reference types, which have an identity, you 
are right, but it doesn’t hold for values.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to