void final_call(context &ctx) { // Take ownership of state (if any), deleting it on return ownedobj_ptr<invocation_data> as(get_state_existing(ctx)); if (as) { // We have state ctx.result(finalfun(as->state)); } else { // There was no allocated state ctx.result(finalfun(state_zero)); } }