例如 DateTime 有
public static TimeSpan operator -(DateTime d1, DateTime d2);
public static DateTime operator -(DateTime d, TimeSpan t);
public static bool operator !=(DateTime d1, DateTime d2);
public static DateTime operator +(DateTime d, TimeSpan t);
public static bool operator <(DateTime t1, DateTime t2);
public static bool operator <=(DateTime t1, DateTime t2);
public static bool operator ==(DateTime d1, DateTime d2);
public static bool operator >(DateTime t1, DateTime t2);
public static bool operator >=(DateTime t1, DateTime t2);
在程序中 如何确定一个对象有 - 或者+ 的运算符呢?
public static TimeSpan operator -(DateTime d1, DateTime d2);
public static DateTime operator -(DateTime d, TimeSpan t);
public static bool operator !=(DateTime d1, DateTime d2);
public static DateTime operator +(DateTime d, TimeSpan t);
public static bool operator <(DateTime t1, DateTime t2);
public static bool operator <=(DateTime t1, DateTime t2);
public static bool operator ==(DateTime d1, DateTime d2);
public static bool operator >(DateTime t1, DateTime t2);
public static bool operator >=(DateTime t1, DateTime t2);
在程序中 如何确定一个对象有 - 或者+ 的运算符呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货