Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created February 28, 2018 09:26
Show Gist options
  • Save vialyx/34b94f71640a4c88fb62b899f60af65e to your computer and use it in GitHub Desktop.
Save vialyx/34b94f71640a4c88fb62b899f60af65e to your computer and use it in GitHub Desktop.
struct User {
let id: Int
let name: String
}
extension User: Hashable {
var hashValue: Int {
return id
}
static func ==(lhs: User, rhs: User) -> Bool {
return lhs.id == rhs.id
}
}
var users: Set<User> = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment