Skip to content

Instantly share code, notes, and snippets.

@Bashta
Created April 27, 2016 16:43
Show Gist options
  • Select an option

  • Save Bashta/2d02059deca9d92466c06b6598b37cd8 to your computer and use it in GitHub Desktop.

Select an option

Save Bashta/2d02059deca9d92466c06b6598b37cd8 to your computer and use it in GitHub Desktop.
public protocol HasAsoluteValue {
func absolute() -> Self
}
public func test<T: HasAsoluteValue>(x: T) -> T {
return x.absolute()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment