Created
April 2, 2018 20:34
-
-
Save Agarunov/f80b670aeb4fea4c852a6558d8b6bf0e 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
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