Created
November 4, 2016 09:15
-
-
Save robnadin/166c5655d9ab8c548c4d1c0862b068f4 to your computer and use it in GitHub Desktop.
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
| // MARK: RawRepresentable Equality | |
| func ==<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: T?, right: U?) -> Bool { | |
| return left == right?.rawValue | |
| } | |
| func !=<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: T?, right: U?) -> Bool { | |
| return left != right?.rawValue | |
| } | |
| func ==<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: U?, right: T?) -> Bool { | |
| return left?.rawValue == right | |
| } | |
| func !=<T: Equatable, U: protocol<RawRepresentable, Equatable> where U.RawValue == T>(left: U?, right: T?) -> Bool { | |
| return left?.rawValue != right | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment