Created
May 25, 2016 17:16
-
-
Save erica/72be2ffe76a569376469c2f2110aee9c 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
// @discardableResult to be added | |
// @noescape needs to move to type annotation | |
// needs to add _ for item | |
public func with<T>(item: T, @noescape update: (inout T) throws -> Void) rethrows -> T { | |
var this = item; try update(&this); return this | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did this end up submitted as a Swift Evolution proposal?