Overload Anonymous Functions

Posted by Nissan Fan on Stack Overflow See other posts from Stack Overflow or by Nissan Fan
Published on 2010-04-16T21:21:46Z Indexed on 2010/04/16 21:23 UTC
Read the original article Hit count: 475

Filed under:
|
|

Still wrapping my head around Delegates and I'm curious: Is it possible to overload anonymous functions?

Such that:

delegate void Output(string x, int y);

Supports:

Output show = (x, y) => Console.WriteLine("{0}: {1}", x.ToString(), y.ToString());

And:

delegate void Output(string x, string y);

Allowing:

show( "ABC", "EFG" );

And:

show( "ABC", 123 );

© Stack Overflow or respective owner

Related posts about anonymous-functions

Related posts about overload