mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Add lazy and Array filter algorithm
This came up during API review Swift SVN r18364
This commit is contained in:
@@ -232,6 +232,12 @@ extension ${Self} : ArrayType {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/// Return a ${Self} containg the elements `x` of `self` for which
|
||||
/// `includeElement(x)` is `true`
|
||||
func filter(includeElement: (T)->Bool) -> ${Self} {
|
||||
return ${Self}(Swift.filter(self, includeElement))
|
||||
}
|
||||
}
|
||||
|
||||
extension ${Self} : Reflectable {
|
||||
|
||||
Reference in New Issue
Block a user