3 public delegate void GenericDelegate<T>(T a);
4 public delegate void ObjectDelegate(object a);
11 TestLoadStore (field);
18 public void TestLoadStore (T arg) {
20 T[] array = new T[10];
31 public void TestByRef (T arg) {
33 T[] array = new T[10];
35 PassByRef (ref array[0]);
36 PassByRef (ref field);
37 PassByRef (ref local);
38 PassByRef (ref staticField);
41 public void TestCalls () {
42 this.field.ToString ();
43 this.field = Static ();
48 public void TestTypeOps () {
49 object o = typeof (T);
54 //T x = o as T; test with constraints
58 public void TestDelegate () {
59 GenericDelegate<T> gd = new GenericDelegate<T>(this.Virtual);
63 public void PassByRef (ref T t) {
67 public virtual void Virtual (T a) {
70 public static T Static() {
80 public static void Main () {
81 new Tst<int> ().Virtual (10);
82 new Tst<string> ().Virtual ("str");
83 new Tst<Foo> ().Virtual (new Foo ());