I\'m trying to gain a deeper understanding of how Swift copies value types:
The behavior you see in your code will always be as if a copy took place. Ho
I'm not sure if there's a "recommended" way to do that, but one method is to use withUnsafePointer(_:_:), like this:
withUnsafePointer(_:_:)
var s: String = "foo" withUnsafePointer(&s) { NSLog("\($0)") }
This printed 0x00007ffff52a011c8 on my machine.
0x00007ffff52a011c8