Execute a function with a disposable resource and clean up after the function scope ends.
Result of function
Disposable resource
function to execute with resource
Execute a function with a disposable resource and clean up after the function scope ends.
Returns
Result of function