我不太确定goto在一个using区块内使用.
例如:
using(stream s = new stream("blah blah blah"));
{
//do some stuff here
if(someCondition) goto myLabel;
}
Run Code Online (Sandbox Code Playgroud)
现在,如果someCondition是,则代码执行将继续进行myLabel,但是,对象是否会被处置?
我在这个主题上看到了一些非常好的问题,但他们都在谈论不同的事情.
当我遇到这段代码时,我只是经历了一些C代码.
void someFunction(Int32 someVariable)
{
/* someVariable is hard coded to 2 */
(void)someVariable;
//some processing that has nothing to do with someVariable.
}
Run Code Online (Sandbox Code Playgroud)
作者在评论中的意思是什么," someVariable被硬编码为2 "?究竟发生了someVariable什么?