Post

Replies

Boosts

Views

Activity

Reply to What do <T> and <S> mean as distinguished from each other.
Hard to tell from the description, but it sounds like S is what the person who wrote the code chose to mean "some other type that doesn't have to be T". See: func test<T, S>(one : T, two : S) -> String { return "\(one) \(two)" } print(test(one: Double(1), two: true)) There are a few places where this can be useful, such as Maps or Dictionaries, where the key type can be anything, and the value type can also be some other anything. (Note: T and S can also be the same thing, like with a Dictionary<String,String>.)
Mar ’22