Skip to content

Instantly share code, notes, and snippets.

@oisdk
Created July 6, 2015 15:00
Show Gist options
  • Save oisdk/f0e46518549b4dcc3f7b to your computer and use it in GitHub Desktop.
Save oisdk/f0e46518549b4dcc3f7b to your computer and use it in GitHub Desktop.
func ==<T : Equatable>(lhs: T?, rhs: T) -> Bool {
return lhs.map{$0 == rhs} ?? false
}
func ==<T : Equatable>(lhs: T, rhs: T?) -> Bool {
return rhs == lhs
}
func ==<T : Equatable>(lhs: T?, rhs: T?) -> Bool {
return lhs.map{$0 == rhs} ?? false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment