The function below does not compile in Swift 3.
func sockaddr_cast(p: UnsafeMutablePointer<Void>) -> UnsafeMutablePointer<sockaddr> {
return UnsafeMutablePointer<sockaddr>(p)
}
It generates the following error:
Cannot invoke initializer for type 'UnsafeMutablePointer' with an argument list of type '(UnsafeMutableRawPointer)'
What's the Swift 3 version of this code?
This question seems similar, but the answer didn't help.