Re: recursive GetEnumerator()
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Mon, 25 Jun 2007 11:29:24 +0200
colin wrote:
I dont think in this case it actually returns anything, at least not thats used.
if I try and return an IEnumerator it complains.
Yes, it does return an enumerator. (Or, at least, it works as if it returns an enumerator. I don't know exactly how it's implemented.)
yield return p.val;Why is the code continuing after return? Did you ignore the compiler warning about unreachable code?
thats the nature of yield I beleive,
Yes, you are right. The code continues at that point for the next step in the enumeration.
--
Göran Andersson
_____
http://www.guffa.com
.
- Follow-Ups:
- Re: recursive GetEnumerator()
- From: colin
- Re: recursive GetEnumerator()
- References:
- recursive GetEnumerator()
- From: colin
- Re: recursive GetEnumerator()
- From: Göran Andersson
- Re: recursive GetEnumerator()
- From: colin
- recursive GetEnumerator()
- Prev by Date: Eventlog watcher
- Next by Date: Re: KeyUp events
- Previous by thread: Re: recursive GetEnumerator()
- Next by thread: Re: recursive GetEnumerator()
- Index(es):
Relevant Pages
|
Loading