The example in the Swift documentation for DenseVector_Double:
var values = [2.20, 2.85, 2.79, 2.87]
let vector = DenseVector_Double(count: Int32(values.count),
data: &values)
stride(from: 0, to: vector.count, by: 1).forEach {i in
print(vector.data[Int(i)])
}
worked fine previously (prior to 5.2 I believe).
It now has a warning:
"Inout expression creates a temporary pointer, but argument 'data' should be a pointer that outlives the call to 'init(count:data:)'"
What would need to be done to fix the example and avoid the error message?