RosettaCodeData/Task/Generic-swap/Swift/generic-swap.swift

4 lines
59 B
Swift

func swap<T>(inout a: T, inout b: T) {
(a, b) = (b, a)
}