Last active
September 5, 2018 14:29
-
-
Save popochess/4021188dbbee4d0846fe1c8ee5ee8918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
之前一直搞不懂 Hashable 跟 Equatable ,剛剛終於懂了 | |
因為 Hashable inherit Equatable,所以 Hashable 除了可以比較 == object 外, 還可以做 great than 跟 less than , hash有 not duplicate的特性,所以也可以做用 duplicate,這樣的用意就可以延伸到做 sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment