Skip to content

Instantly share code, notes, and snippets.

@twof
Created January 27, 2017 07:48
Show Gist options
  • Select an option

  • Save twof/6b8ac8e287d3d68c247fe16a8e90f62b to your computer and use it in GitHub Desktop.

Select an option

Save twof/6b8ac8e287d3d68c247fe16a8e90f62b to your computer and use it in GitHub Desktop.
func swapTwoInts(_ a: inout Int, _ b: inout Int) {
let temporaryA = a
a = b
b = temporaryA
}
func swapTwoDoubles(_ a: inout Double, _ b: inout Double) {
let temporaryA = a
a = b
b = temporaryA
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment