What is a non-local return?

前端 未结 3 2003
滥情空心
滥情空心 2021-02-19 10:53

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

3条回答
  •  盖世英雄少女心
    2021-02-19 11:49

    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.

提交回复
热议问题