[swift-users] How to create an uninitialized pointer in Swift 3
martinr448 at gmail.com
Fri Sep 16 02:30:33 CDT 2016
In Swift 3, COpaquePointer was renamed to OpaquePointer, and nullable pointers are represented by optionals:
SE-0055 – Make unsafe pointer nullability explicit using Optional
So the following should work in Swift 3:
var cublasHandle: OpaquePointer?
let status = cublasCreate_v2(&cublasHandle)
> On 15 Sep 2016, at 23:38, Lane Schwartz via swift-users <swift-users at swift.org> wrote:
> In Swift 2.2, I could do the following:
> var cublasHandle : COpaquePointer = nil
> let status = cublasCreate_v2(&cublasHandle)
> Where cublasCreate_v2 is a C function that takes a pointer, and then initializes some memory at that address.
> I haven't been able to figure out an equivalent in Swift 3. Any suggestions, especially to documentation, would be greatly appreciated.
> swift-users mailing list
> swift-users at swift.org
More information about the swift-users