Avatar
VariadicGenerics来ましたね func zip<each S>(_ sequence: repeat each S) where each S: Sequence struct Pair<First, Second> { init(_ first: First, _ second: Second) } func makePairs<each First, each Second>( firsts first: repeat each First, seconds second: repeat each Second ) -> (repeat Pair<each First, each Second>) { return (repeat Pair(each first, each second)) } let pairs = makePairs(firsts: 1, "hello", seconds: true, 1.0) // 'pairs' is '(Pair(1, true), Pair("hello", 2.0))' https://forums.swift.org/t/se-0393-value-and-type-parameter-packs/63859 (edited)
Hello Swift community, The review of SE-0393: Value and Type Parameter Packs begins now and runs through April 3, 2023. For those who've followed along during the pitch phase for this feature, you'll note that the proposed syntax has changed based on implementation experience. While it is within the scope of review to consider an alternative ...
👀 7