Essential .NET - Custom Iterators with Yield RRS feed

  • General discussion

  • Mark Michaelis continues his exploration into the internals of the C# foreach statement, with a focus on the new contextual keyword—yield—that C# uses to generate the underlying CIL code that implements the iterator pattern used by the foreach loop.

    Read this article in the June 2017 issue of MSDN Magazine

    Tuesday, June 13, 2017 6:22 PM

All replies

  • Great article. The material presented greatly helps people in understanding, but it should be pointed out that there are some key differences between the implementations presented and that which is actually used in the .NET supplied collections and iterators...

    Microsoft ALM Ranger

    Wednesday, June 28, 2017 1:30 PM