Extend array types using where clause in Swift

后端 未结 7 2012
青春惊慌失措
青春惊慌失措 2020-11-28 07:35

I\'d like to use the Accelerate framework to extend [Float] and [Double] but each of these requires a different implementation.

I tried the obvious:

         


        
7条回答
  •  没有蜡笔的小新
    2020-11-28 08:05

    Swift 3 to the rescue!!

    extension Collection where Iterator.Element == Int {
        // `Collection` can be `Sequence`, etc
    }
    

提交回复
热议问题