2 using System
.Collections
.Generic
;
6 internal struct TestClass4
<T
> : IEquatable
<TestClass4
<T
>>, IEquatable
<T
>, IEqualityComparer
<TestClass4
<T
>> where T
: class
8 public bool Equals (T obj
)
13 public bool Equals (TestClass4
<T
> entry
)
18 public bool Equals (TestClass4
<T
> x
, TestClass4
<T
> y
)
23 public int GetHashCode (TestClass4
<T
> obj
)
25 return obj
.GetHashCode ();
28 public override int GetHashCode ()
33 public override bool Equals (object obj
)
38 public static bool operator == (TestClass4
<T
> entry1
, TestClass4
<T
> entry2
)
40 return entry1
.Equals (entry2
);
43 public static bool operator == (T entry1
, TestClass4
<T
> entry2
)
45 return entry2
.Equals (entry1
);
48 public static bool operator == (TestClass4
<T
> entry1
, T entry2
)
50 return entry1
.Equals (entry2
);
53 public static bool operator == (object entry1
, TestClass4
<T
> entry2
)
55 return entry2
.Equals (entry1
);
58 public static bool operator == (TestClass4
<T
> entry1
, object entry2
)
60 return entry1
.Equals (entry2
);
63 public static bool operator != (TestClass4
<T
> entry1
, TestClass4
<T
> entry2
)
65 return !(entry1
== entry2
);
68 public static bool operator != (T entry1
, TestClass4
<T
> entry2
)
70 return !(entry1
== entry2
);
73 public static bool operator != (TestClass4
<T
> entry1
, T entry2
)
75 return !(entry1
== entry2
);
78 public static bool operator != (object entry1
, TestClass4
<T
> entry2
)
80 return !(entry1
== entry2
);
83 public static bool operator != (TestClass4
<T
> entry1
, object entry2
)
85 return !(entry1
== entry2
);
91 public static void Main ()
93 new TestClass4
<string> ();