[swift-users] Extending Arrays of specific type, and specialization
Adrian Zubarev
adrian.zubarev at devandartist.com
Tue Nov 22 05:39:54 CST 2016
It’s already fixed for Swift 3.1.
Here is the change log.
--
Adrian Zubarev
Sent with Airmail
Am 22. November 2016 um 01:32:42, Rick Mann via swift-users (swift-users at swift.org) schrieb:
My googling is not turning up an answer that works in Xcode 8.1. I'd like to do this:
import Accelerate
extension
Array
where Element == Double
{
func
sum()
-> Double
{
var result: Double = 0.0
vDSP_sveD(self, 1, &result, vDSP_Length(self.count))
return result
}
}
But I get "same-type requirement makes generic parameter 'Element' non-generic."
Also, will there ever be any way to specialize something like
let numbers: [Double] = ...
let sum = numbers.reduce(0.0, +)
Into a call to vDSP_sveD()? Would it require compiler optimizations for Accelerate?
Thanks!
--
Rick Mann
rmann at latencyzero.com
_______________________________________________
swift-users mailing list
swift-users at swift.org
https://lists.swift.org/mailman/listinfo/swift-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161122/929ebd35/attachment.html>
More information about the swift-users
mailing list