有机会使这段代码有效吗?当然我可以对Foo做出第二个定义,但我认为它有点不优雅;)
delegate int Del(int x); static int Foo(int a, int b = 123) { return a+b; } static void Main() { Del d = Foo; }
c# delegates optional-parameters
c# ×1
delegates ×1
optional-parameters ×1