Created
May 14, 2017 22:45
-
-
Save chriswebb09/f02135c29b6a86b36732ab5aaa04e2dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class Element: Hashable { | |
| var value: Int | |
| var hashValue: Int { | |
| return value * 10 | |
| } | |
| init(value: Int) { | |
| self.value = value | |
| } | |
| } | |
| extension Element: Equatable { | |
| static func ==(lhs: Element, rhs: Element) -> Bool { | |
| return lhs.hashValue == rhs.hashValue | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment