Generic Initializer

init(_:)

Explicit construction from an UnsafeMutablePointer.

Declaration

init?<U>(_ from: UnsafeMutablePointer<U>?)

Discussion

Returns nil if from is nil.

This is inherently unsafe; UnsafeMutablePointer assumes the referenced memory has +1 strong ownership semantics, whereas AutoreleasingUnsafeMutablePointer implies +0 semantics.

See Also

Converting Pointers

init<U>(UnsafeMutablePointer<U>)

Explicit construction from an UnsafeMutablePointer.