Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Agarunov/f80b670aeb4fea4c852a6558d8b6bf0e to your computer and use it in GitHub Desktop.
Save Agarunov/f80b670aeb4fea4c852a6558d8b6bf0e to your computer and use it in GitHub Desktop.
struct Point: Hashable {
let x: Float
let y: Float
}
let p1 = Point(x: 0.0, y: 0.0)
let p2 = Point(x: 1.0, y: 1.0)
p1 == p2 // false
// также можно использовать в сете
var set = Set<Point>()
set.insert(p1)
set.insert(p2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment