Swift “where” Array Extensions
问题 As of Swift 2.0 it seems we can get closer to extensions of generic types applicable to predicated situations. Although we still can't do this: protocol Idable { var id : String { get } } extension Array where T : Idable { ... } ...we can now do this: extension Array { func filterWithId<T where T : Idable>(id : String) -> [T] { ... } } ...and Swift grammatically accepts it. However, for the life of me I cannot figure out how to make the compiler happy when I fill in the contents of the