How can i obtain in C# a specific operator's function?

Posted by Silviu on Stack Overflow See other posts from Stack Overflow or by Silviu
Published on 2010-03-19T10:11:08Z Indexed on 2010/03/19 10:11 UTC
Read the original article Hit count: 334

Filed under:
|
|
|

Is it possible to obtain the function behind a C# operator? For example in F# you can do

let add = (+);;

val add : (int -> int -> int)

Is it possible in c# to do something like this:

Func<int, int, int> add = (+);

or

Func<int, int, int> add = Int32.(+)

?

© Stack Overflow or respective owner

Related posts about c#

Related posts about operator-overloading