How to understand the join function in this string extension?
Using Open Quickly
in Xcode I found this extension String
:
extension String {
func join<S : SequenceType where String == String>(elements: S) -> String
}
I expect it to be
extension String {
func join<S : SequenceType where S.Element == String>(elements: S) -> String
}
because I think the goal should be to ensure the elements are in sequence String
when passing to a function join
.
So my questions are:
- Is the function declaration correct in Xcode 6 GM?
- If so, why does it make sense?
+3
source to share
No one has answered this question yet
See similar questions:
or similar: