mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib/Join: add forwarding join() instance functions to array and string types
rdar://16388632 Swift SVN r18493
This commit is contained in:
@@ -228,6 +228,13 @@ extension ${Self} : ArrayType {
|
||||
}
|
||||
|
||||
//===--- algorithms -----------------------------------------------------===//
|
||||
|
||||
func join<
|
||||
S : Sequence where S.GeneratorType.Element == ${Self}<T>
|
||||
>(elements: S) -> ${Self}<T> {
|
||||
return Swift.join(self, elements)
|
||||
}
|
||||
|
||||
func reduce<U>(initial: U, combine: (U, T)->U) -> U {
|
||||
return Swift.reduce(self, initial, combine)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user