Last active
February 22, 2016 02:54
-
-
Save schveiguy/56b142e389c8bd8d2b55 to your computer and use it in GitHub Desktop.
Code for swift/d comparison
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
struct S | |
{ | |
var x : Int // uses hidden storage | |
var xTimes10 : Int { | |
get { | |
return x * 10 | |
} | |
set { | |
x = newValue / 10 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment