Global Functionswift 6.0.1Swift
withExtendedLifetime(_:_:)
Evaluates a closure while ensuring that the given instance is not destroyed before the closure returns.
func withExtendedLifetime<T, E, Result>(_ x: borrowing T, _ body: () throws(E) -> Result) throws(E) -> Result where E : Error, T : ~Copyable, Result : ~Copyable
Parameters
Returns
The return value, if any, of the body
closure parameter.