stdlib/Join: add forwarding join() instance functions to array and string types

rdar://16388632


Swift SVN r18493
This commit is contained in:
Dmitri Hrybenko
2014-05-21 13:15:30 +00:00
parent 3fab925b77
commit 9a4004ab61
4 changed files with 47 additions and 0 deletions

View File

@@ -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)
}