次のラムダの例を使用するには、どうすればよいですか?MSDNサイトのこのラムダの例はなぜ機能しませんか?
ERROR:のみ割り当て、呼び出し、インクリメント、デクリメント、および新しいオブジェクト式は、ステートメント
http://msdn.microsoft.com/en-us/library/bb397687.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
namespace TestLambda
{
class Program
{
static void Main(string[] args)
{
delegate int del(int i);
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 25
}
}
}
JaredParがそれをカバーしています。 MSDNサンプルは省略されることがあります。おそらく、省略記号はここではっきりしていたでしょう... –