Cannot convert value of same type

488 views Asked by At

I cannot seem to call vDSP* accelerate functions. I get the following error:

Cannot convert value of type 'UnsafePointer<Float>' to expected argument type 'UnsafePointer<Float>'

Sample code:

var m:Float = 0.0 as! Float
var points : [Float]

points.withUnsafeBufferPointer {(buffer: UnsafeBufferPointer<Float>) -> Void in
        vDSP_minv(buffer.baseAddress!, vDSP_Stride(2), &m, vDSP_Length(2))
}

Any suggestions much appreciated!

1

There are 1 answers

0
George On

I was experimenting with generics and overloaded my class mistakenly using the Float class which caused the strange error message:

class bar<Float> { ... }