Last active
November 1, 2019 20:34
-
-
Save BigZaphod/ab3f86c582ff7358b9fc74f51a6f06f7 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
protocol ReferenceEquatable: AnyObject, Equatable {} | |
extension ReferenceEquatable { | |
static func == (lhs: Self, rhs: Self) -> Bool { | |
return lhs === rhs | |
} | |
} | |
protocol ReferenceHashable: ReferenceEquatable, Hashable {} | |
extension ReferenceHashable { | |
func hash(into hasher: inout Hasher) { | |
ObjectIdentifier(self).hash(into: &hasher) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment