Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created May 14, 2017 22:45
Show Gist options
  • Select an option

  • Save chriswebb09/f02135c29b6a86b36732ab5aaa04e2dc to your computer and use it in GitHub Desktop.

Select an option

Save chriswebb09/f02135c29b6a86b36732ab5aaa04e2dc to your computer and use it in GitHub Desktop.
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