4 public static Comparison
<U
> WrapComparison
<U
>(Comparison
<U
> comparison
)
6 return delegate(U x
, U y
) { return comparison(x, y); }
;
9 public delegate int MyComparison
<V
> (V x
, V y
);
10 public static MyComparison
<W
> WrapMyComparison
<W
>(MyComparison
<W
> myComparison
)
12 return delegate(W x
, W y
) { return myComparison(x, y); }
;
17 static int compare (int x
, int y
)
19 static int compare (string x
, string y
)
20 { return string.Compare (x, y); }
21 static void test (int i
)
24 throw new Exception (""+i
);
26 public static void Main ()
28 Comparison
<int> ci
= Test
.WrapComparison
<int> (compare
);
29 Comparison
<string> cs
= Test
.WrapComparison
<string> (compare
);
30 Test
.MyComparison
<int> mci
= Test
.WrapMyComparison
<int> (compare
);
31 Test
.MyComparison
<string> mcs
= Test
.WrapMyComparison
<string> (compare
);
35 test (mcs ("g", "g"));