Last active
May 28, 2016 08:28
-
-
Save austinzheng/0167422bda561739e912929f26d7f9b8 to your computer and use it in GitHub Desktop.
aaaaaaaaaaaaaaaaaaaaa
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 ==(lhs: (), rhs: ()) -> Bool { | |
return true | |
} | |
func ==<...T : Equatable>(lhs: (T...), rhs: (T...)) -> Bool { | |
let firstLeft : #First(T...) = #first(lhs) | |
let firstRight : #First(T...) = #first(rhs) | |
let firstAreEqual = (firstLeft == firstRight) | |
if !firstAreEqual { | |
return false | |
} else { | |
let restLeft : (#Rest(T...)) = (#rest(#unpack(lhs))) | |
let restRight : (#Rest(T...)) = (#rest(#unpack(rhs))) | |
return restLeft == restRight | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment