Skip to content

Instantly share code, notes, and snippets.

@LucianoPAlmeida
Last active January 16, 2019 01:14
Show Gist options
  • Save LucianoPAlmeida/221311c71fa7c08f8bff8bd239979035 to your computer and use it in GitHub Desktop.
Save LucianoPAlmeida/221311c71fa7c08f8bff8bd239979035 to your computer and use it in GitHub Desktop.
@_specialize(exported: true, where T==UInt)
func increment<T: BinaryInteger>(_ t: T) -> T {
let incremented = t + 1
return incremented
}
var i: Int = 1
i = increment(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment