Source of an iterator example: http://gist.github.com/524972
What the compiler generates for the above example: http://gist.github.com/524974
The meat of it is in the MoveNext() function, where the original function is split up along the yield keywords into cases in a switch statement.
Source of an iterator example: http://gist.github.com/524972
What the compiler generates for the above example: http://gist.github.com/524974
The meat of it is in the MoveNext() function, where the original function is split up along the yield keywords into cases in a switch statement.