---
layout: "default"
title: "withExtendedLifetime"
description: "Swift documentation for 'withExtendedLifetime': Evaluate f(x) and return its result, ensuring that x is not
destroyed before f returns."
keywords: "withExtendedLifetime,func,swift,documentation"
root: "/v2.0"
---

<div class="declaration" id="func-withextendedlifetime-t-result_-t_-t-throws-result">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-withextendedlifetime-t-result_-t_-t-throws-result">func withExtendedLifetime&lt;