Created
February 2, 2017 08:59
-
-
Save P0ed/9ff76c4a1a532b77afb0f4dd1c4be40b to your computer and use it in GitHub Desktop.
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
infix operator ?= : AssignmentPrecedence | |
func ?= <A>(lhs: inout A, rhs: A?) { | |
if let value = rhs { | |
lhs = value | |
} | |
} | |
func ?= <A>(lhs: inout A?, rhs: A?) { | |
if let value = rhs { | |
lhs = .some(value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment