据我所知,最短的方法是:
var myStruct = TheStruct()var address = withUnsafeMutablePointer(&myStruct) {UnsafeMutablePointer<Void>(func foo(arg:UnsafeMutablePointer<Void>) { //...}var myStruct = TheStruct()foo(&myStruct))}
但是,为什么需要这个呢?如果要将其作为参数传递,则可以(并且应该):
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)