- 485 名前:デフォルトの名無しさん mailto:sage [2007/12/11(火) 19:02:48 ]
- Yieldの使い方を根本的に間違ってるわけだけどな。
Yieldを含む IEnumerableなファンクションが暗黙にいろいろやってくれる。 この例だとstaticにしてもいいな。 public class Sample { public IEnumerable<char> Hoge() { yield return 'C'; } } foreach (char c in new Sample().Hoge()) Console.Write("{0}", c);
|

|