为什么我重载了System.Type的大于操作符
在同一个类中 却无法使用呢?public static class OperatorTest
{
public static bool operator >(Type typeSource, Type typeTarget)
{
if (typeTarget.IsAssignableFrom(typeSource)) return true;
return false;
}
public static bool operator >=(Type typeSource, Type typeTarget)
{
//typeSource > typeTarget报错了
return typeSource > typeTarget ||
typeTarget == typeSource;
}
}
在同一个类中 却无法使用呢?public static class OperatorTest
{
public static bool operator >(Type typeSource, Type typeTarget)
{
if (typeTarget.IsAssignableFrom(typeSource)) return true;
return false;
}
public static bool operator >=(Type typeSource, Type typeTarget)
{
//typeSource > typeTarget报错了
return typeSource > typeTarget ||
typeTarget == typeSource;
}
}
解决方案 »
- c# 如何让程序实现事务 类似于c#里面的数据库事务Transaction
- 在c#与access数据库使用时,OleDbDataReader rd = cmd.ExecuteReader();出错,请帮忙!谢谢
- 求解决错误:命名空间“System.Web”中不存在类型或命名空间名称“HttpContext”
- ◆请告诉帮帮菜鸟◆
- 刚开始学ASP求教在Windows XP mode安装IIS的问题
- WinForm窗体中条码打印的问题?
- C#打开WORD时报WORD未能引发事件可能是什么原因呢
- 这个SQL语句应该怎么这与?
- chart控件显示不出来
- 水晶报表闪烁的问题
- vs2010运行的错误
- ASP.NET页面调试方式问题
{
if (typeTarget.IsAssignableFrom(typeSource)) return true;
return false;
}
public static bool operator >=(OperatorTest typeSource, OperatorTest typeTarget)
{
typeSource > typeTarget报错了
return typeSource > typeTarget ||
typeTarget == typeSource;
}