for inout t in someTs
someTs.map { $0 }
で、これの戻り値の型を Ts
じゃなく [P1]
にするならいい。 (edited)modifyEach
と for inout
があれば Ts
のまま操作できるし、その場合は要素を P1
として扱えるから色々できるし、あとは集約して別の型に変換するくらいしかできることなさそう。...
展開出てこないの?? struct ZipSequence<S1: Sequence, S2: Sequence, Ss: variadic Sequence> { private let s1: S1 private let s2: S2 private let ss: Ss // used as a type here, in a property declaration... // ... and here in a function signature init(_ s1: S1, _ s2: S2, _ ss: Ss) { (self.s1, self.s2, self.ss) = (s1, s2, ss) } }