Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
已知可以分配一个不返回值给Action<T>对象的 lambda。理论上返回值的 lambdas 怎么样?像这个:
Action<T>
Action<double> result = (x => x + 1);
结果会被忽略吗?
谢谢!
你使用一个Func
Func
Func<double, double> result = (x => x + 1);
如果你这样写,那么结果可以被忽略。虽然这个例子不是非常有用
Action<double> result = x => { x + 1; };