摘要: 本篇博客所讲的是C#泛型中的协变和逆变。 首先讲协变: 协变 要把泛型参数定义为协变,可在类型定义中使用out关键字,例如: public interface IEnumerable<out T> : IEnumerable { IEnumerator<T> GetEnumerator(); } 相 阅读全文
posted @ 2020-04-05 12:48 飞天猪皮怪 阅读(422) 评论(0) 推荐(0) 编辑