Created
July 27, 2014 17:17
-
-
Save rnapier/411a710ebb725677b25d to your computer and use it in GitHub Desktop.
Tuple equatable
This file contains hidden or 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 ==<A:Equatable, B:Equatable>(lhs:(A,B), rhs:(A,B)) -> Bool { | |
return lhs.0 == rhs.0 | |
&& lhs.1 == rhs.1 | |
} | |
func ==<A:Equatable, B:Equatable, C:Equatable>(lhs:(A,B,C), rhs:(A,B,C)) -> Bool { | |
return lhs.0 == rhs.0 | |
&& lhs.1 == rhs.1 | |
&& lhs.2 == rhs.2 | |
} | |
func ==<A:Equatable, B:Equatable, C:Equatable, D:Equatable>(lhs:(A,B,C,D), rhs:(A,B,C,D)) -> Bool { | |
return lhs.0 == rhs.0 | |
&& lhs.1 == rhs.1 | |
&& lhs.2 == rhs.2 | |
&& lhs.3 == rhs.3 | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment