【发布时间】:2016-04-04 19:18:25
【问题描述】:
public static explicit operator int(Author a)
{
return a.Publications.Length;
}
public static implicit operator int(Author a)
{
return a.Publications.Length;
}
为什么我不能这样做?我的老师要求我覆盖 Author 类的 operator int 的隐式和显式转换。 + 我能得到关于深拷贝的解释吗:D?
【问题讨论】:
-
要求我们推荐或查找书籍、工具、软件库、教程或其他场外资源的问题不属于 Stack Overflow 的主题
-
我建议你向你的老师寻求澄清,因为这个要求似乎是错误的。
-
不要在一个问题中问两个问题。如果您有两个问题,请发布两个问题。
标签: c# overriding implicit explicit