Avatar
extension Array { public subscript(_ f: (Int, Int) -> ClosedRange<Int>) -> ArraySlice<Element> { return self[startIndex..<endIndex] } }
6:04 AM
Swift 3.1 でできた。 (edited)
6:04 AM
let ns = [2, 3, 5] ns[...] // [2, 3, 5]