为什么VS上没有

weikeli19 2016-08-19 09:00:43
为什么VS上的List<T>类 没有IEnumerator<T> IEnumerable<T>.GetEnumerator()和System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 而这个上面就有574行和578行http://referencesource.microsoft.com/#mscorlib/system/collections/generic/list.cs,9c3d580a8b7a8fe8
...全文
94 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
D56233577 2016-08-19
  • 打赏
  • 举报
回复
public interface IList<T> : ICollection<T>, IEnumerable<T>, IEnumerable 明显有,为什么说没有?
weikeli19 2016-08-19
  • 打赏
  • 举报
回复
引用 6 楼 xuzuning 的回复:
公有的?怎么没有 public ?
你看这个http://blog.163.com/xkc_tx/blog/static/1745982402010112833140721/
weikeli19 2016-08-19
  • 打赏
  • 举报
回复
引用 6 楼 xuzuning 的回复:
公有的?怎么没有 public ?
因为它是显示接口的实现 语法规定没有public 呀
xuzuning 2016-08-19
  • 打赏
  • 举报
回复
公有的?怎么没有 public ?
weikeli19 2016-08-19
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
私有的方法当然不会暴露出来
只不过它是显示接口实现
weikeli19 2016-08-19
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
私有的方法当然不会暴露出来
是公有的 不是私有的 这点你错了
xuzuning 2016-08-19
  • 打赏
  • 举报
回复

私有的方法当然不会暴露出来
Forty2 2016-08-19
  • 打赏
  • 举报
回复
因为VisualStudio的对象浏览(Object Broswer)窗口只显示公共成员。 IEnumerable<T>.GetEnumerator等,属于显式接口实现,不是List<T>的公共方法。
weikeli19 2016-08-19
  • 打赏
  • 举报
回复
而http://referencesource.microsoft.com/#mscorlib/system/collections/generic/list.cs,9c3d580a8b7a8fe8这个上面就有 在574行和578行

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧