Created
June 30, 2014 13:31
-
-
Save advantis/27e6e88f98f2728fa5a9 to your computer and use it in GitHub Desktop.
Swift null coalescing operator
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
operator infix || {} | |
@infix func ||<T>(lhs: T?, rhs: T) -> T { | |
return lhs ? lhs! : rhs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment