我知道 C# 中的 3 种参数评估类型:
- 默认,即按值
- ref,即by-ref
- out,它是 by-ref 但被认为最初未初始化且必须分配
我的教授说 C# 也支持 by-result,他解释为:
- Argument has to be LHS-compatible
- Create local copy of argument and operate on that
- After successful processing of method body, write value of copy back to the parameter source
我不明白 this 是如何引用上述任何类型的。
最佳答案
简短的回答 - 不,它没有。
关于c# - C# 是否支持按结果调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24644281/