摘要:
URI:http://www.albahari.com/nutshell/cs4ch07.aspx集合:Implementing IEnumerable<T> with an iterator(实现IEnumerable<T>的迭代器):public class MyGenCollection : IEnumerable<int>{ int[] data = {1, 2, 3}; public IEnumerator<int> GetEnumerator() { foreach (int i in data) yield return i; } 阅读全文
posted @ 2011-12-20 15:19
magic_evan
阅读(282)
评论(0)
推荐(0)
浙公网安备 33010602011771号