public static explicit operator int(Author a)
{
return a.Publications.Length;
}
public static implicit operator int(Author a)
{
return a.Publications.Length;
}
Run Code Online (Sandbox Code Playgroud)
为什么我不这样做?我的老师让我覆盖了Author类的operator int的隐式和显式转换.+我可以得到深拷贝的解释:D?