七、泛型
func swapTwoInts(_ a:inout Int, _ b:inout Int) {
let temp = a
a = b
b = temp
}
func swaoTwoValues<T>(_ a:inout T, _ b:inout T) {
let temp = a
a = b
b = temp
}
var a = 13, b = 12
swapTwoInts(&a, &b)
print(a, b)
var aStr = "12", bStr = "333"
//swapTwoInts(&aStr, &bStr)
swaoTwoValues(&a, &b)
print(a, b)
swaoTwoValues(&aStr, &bStr)
print(aStr, bStr)
// 上面的