Hello all,
I'm trying to get an UnsafeMutablePointer from an
UnsafeMutableRawPointer obtained using the Unmanaged structure:
class C { var foo = 42, bar = "bar" }
let c = C()
let rawPointer = Unmanaged.passUnretained(c).toOpaque()
let pointer = rawPointer.bindMemory(to: C.self, capacity: 1)
let
Hello all,
Considering the following code:
var n = 42
let ptr1 = UnsafeMutablePointer(&n)
let ptr2: UnsafeMutablePointer = UnsafeMutablePointer.init(&n)
let ptr3 = UnsafeMutablePointer.init(&n)
I get "Ambiguous use of init" for ptr3. There are no issues with ptr1
and ptr2. Is this a bug or am I
Thanks Braden for pointing out that toOpaque() was just a cast of c to
UnsafeMutableRawPointer. And thanks Guillaume too, I now understand why
my code doesn't and can't work.
All this messing around has confused me greatly and I lost track of
what I originally wanted to do :).
At first, I wanted
Hi,
Not very practical but you can find them with archive.org, e.g.:
https://web.archive.org/web/20160131231037/https://swift.org/documentation/
or with a direct link:
https://web.archive.org/web/20160131231037/https://swift.org/documentation/TheSwiftProgrammingLanguage(Swift2.2).epub
Nick
On