Created
February 20, 2018 15:58
-
-
Save elliottwilliams/d17f043bb0fabf589aff919b75267535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix operator * | |
protocol Dereferencable { | |
associatedtype DereferencablePointee | |
static prefix func * (pointer: Self) -> DereferencablePointee | |
} | |
extension UnsafePointer: Dereferencable { | |
typealias DereferencablePointee = Pointee | |
static prefix func * (pointer: UnsafePointer) -> Pointee { | |
return pointer.pointee | |
} | |
} | |
func foo<T>(p: UnsafePointer<T>) { | |
let t = *p | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment