输入无效的Lambda表达式 [英] Lambda expression with a void input
本文介绍了输入无效的Lambda表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
好吧,这很愚蠢。
x => x * 2
是代表
int Foo(x) { return x * 2; }
但是lambda等价于什么
But what is the lambda equivalent of
int Bar() { return 2; }
??
非常感谢!
推荐答案
等效的lambda等于()=> 2
。
The nullary lambda equivalent would be () => 2
.
这篇关于输入无效的Lambda表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文