摘要: 本篇我们讨论for和foreach配合yield的情况。首先看如下代码以及生成的隐藏类。 public static IEnumerable Power(int baseNumber, int highExponent) { int result = 1; for (int counter = 1; counter <= highExponent; counter++) { result = result * baseNumber; ... 阅读全文
posted @ 2012-12-13 23:05 楼上那个蜀黍 阅读(1530) 评论(1) 推荐(0) 编辑