blob: 50a509aaf6836860e005fccde62e5a8fb6abe67a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
public class Generic<T>
{
private T[,] container = new T[1,1];
public T this [int row, int col]
{
get {
return container[row, col];
}
set {
container[row, col] = value;
}
}
}
public struct Fault
{
public static void Main ()
{
Generic<Fault> gen = new Generic<Fault> ();
gen[0, 0] = new Fault ();
System.Console.WriteLine (gen[0, 0].ToString ());
}
public override string ToString ()
{
return "Hi!";
}
}
|