Skip to content

Instantly share code, notes, and snippets.

@austinzheng
Last active May 22, 2016 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinzheng/5ce4b1e9e21984bf626988ec5337a791 to your computer and use it in GitHub Desktop.
Save austinzheng/5ce4b1e9e21984bf626988ec5337a791 to your computer and use it in GitHub Desktop.
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