Comparable
Last active
June 9, 2016 18:58
-
-
Save pauljohanneskraft/6a1a73d35d900d26ddb709e8173c50c8 to your computer and use it in GitHub Desktop.
extension Bool : Comparable
This file contains 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
extension Bool : Comparable {} | |
public func < (lhs: Bool, rhs: Bool) -> Bool { | |
return !lhs && rhs | |
} | |
func == (lhs: Bool, rhs: Bool) -> Bool { | |
return (lhs && rhs) || (!lhs && !rhs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment