Created
September 1, 2018 19:14
-
-
Save Catfish-Man/e4887ba3cd6f681a574c22d741c49808 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
func g(_ x: inout Int) { | |
x = x * x | |
} | |
func f() { | |
var computed:Int { | |
get { return 5 } | |
set { print(newValue) } | |
} | |
g(&computed) | |
} | |
f() //prints 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment