新版本的变更 / Swift 6.2

// *** in version 6.2: ***
//Span is a safe view over a contiguous
//piece of memory: no copying, no pointers
func total(_ span: Span<Int>) -> Int {
    var sum = 0
    for i in span.indices {
        sum += span[i]
    }
    return sum
}

let rgb: [3 of Int] = [2551280]
print("total is \(total(rgb.span))")
//total is 383