Last active
May 22, 2016 07:30
-
-
Save austinzheng/5ce4b1e9e21984bf626988ec5337a791 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
func compare(a: Any, b: Any) -> Bool { | |
if let a = a as? Equatable, a openas T { | |
if let b = b as? Equatable, b openas T { | |
return a == b | |
} | |
} | |
fatalError("a and b aren't comparable") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment