Template function in C# - Return Type?

Posted by LifeH2O on Stack Overflow See other posts from Stack Overflow or by LifeH2O
Published on 2010-06-15T21:12:36Z Indexed on 2010/06/15 21:22 UTC
Read the original article Hit count: 249

It seems that c# does not support c++ like templates.

template <class myType>
myType GetMax (myType a, myType b) {
 return (a>b?a:b);
}

I want my function to have return type based on its parameters, how can i achieve this in c#? How to use templates in C#

© Stack Overflow or respective owner

Related posts about c#

Related posts about templates