-
Notifications
You must be signed in to change notification settings - Fork 37
019 Generics
petro edited this page Aug 8, 2013
·
1 revision
You can use generics in S# through the syntax
MethodName<|TypeName|>(...)
For example it you have an Attach method you can call it with the string type as follows:
Attach<|string|>(...)
and create instances of generic types:
list = new List<|string|>(...)
Example of using generic method (C#):
public class TestGeneric
{
public string GenericGet<T>(T input)
{
return input.ToString();
}
}
S#:
a = new TestGeneric();
return a.GenericGet<|string|>('Hello World');