Created
October 7, 2016 12:29
-
-
Save ast3150/c13a3f47743b4fdf22e1b43aa0581708 to your computer and use it in GitHub Desktop.
Revisions
-
ast3150 created this gist
Oct 7, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ precedencegroup optionalAssignPrecedence { associativity: left higherThan: AssignmentPrecedence } /// If rhs has a value, assigns rhs to lhs /// If rhs is an empty optional, does nothing infix operator ?= : optionalAssignPrecedence func ?=<T: Any>(lhs: inout T, rhs: T?) { if let rhs = rhs { lhs = rhs } }