什么是非本地回报? [英] What is a non-local return?

查看:141
本文介绍了什么是非本地回报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非本地回报是什么?在哪些情况下它有用?请给出一个例子来解释。

What is non local return? In what scenarios it is useful? Please give an example to explain.

推荐答案

它意味着退出一个函数并结束函数调用旁边的其他位置。它主要用于引用异常(即, try throw 和<$ Java和C ++中的c $ c> catch ),但它也可以表示像C中的 setjmp / longjmp 这样的机制。

It means exiting a function and ending up someplace else beside where the function was called. It's primarily used to refer to exceptions (i.e., try, throw, and catch in Java and C++), but it can also mean mechanisms like setjmp/longjmp in C.

这篇关于什么是非本地回报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆