Skip to content

Instantly share code, notes, and snippets.

@austinzheng
Last active May 28, 2016 08:28
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/0167422bda561739e912929f26d7f9b8 to your computer and use it in GitHub Desktop.
Save austinzheng/0167422bda561739e912929f26d7f9b8 to your computer and use it in GitHub Desktop.
aaaaaaaaaaaaaaaaaaaaa
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