withExtendedLifetime

func withExtendedLifetime<T, Result>(_: T, _: () throws -> Result)

Evaluate f() and return its result, ensuring that x is not destroyed before f returns.

Declaration

func withExtendedLifetime<T, Result>(_ x: T, _ body: () throws -> Result) rethrows -> Result
func withExtendedLifetime<T, Result>(_: T, _: (T) throws -> Result)

Evaluate f(x) and return its result, ensuring that x is not destroyed before f returns.

Declaration

func withExtendedLifetime<T, Result>(_ x: T, _ body: (T) throws -> Result) rethrows -> Result