using System.Collections.Generic;
#endif
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
#if NET_2_0
namespace System {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public static class Nullable {
public static int Compare<T> (Nullable<T> left, Nullable<T> right) where T: struct
{
public override bool Equals (object other)
{
+ if (other == null)
+ return has_value == false;
if (!(other is Nullable<T>))
return false;
if (has_value)
return value.ToString ();
else
- return "";
+ return String.Empty;
}
public static implicit operator Nullable<T> (T value)
return value.Value;
}
- public static bool operator == (Nullable<T> left, Nullable<T> right)
- {
- return left.Equals (right);
- }
-
- public static bool operator != (Nullable<T> left, Nullable<T> right)
- {
- return !left.Equals (right);
- }
-
-
// These are called by the JIT
// Ironicly, the C# code is the same for these two,
// however, on the inside they do somewhat different things