Generator (computer programming): Difference between revisions

Content deleted Content added
Uses: Typo
Line 429:
===C#===
An example C# 2.0 generator (the <code>yield</code> is available since C# version 2.0):
Both of these examples utiliseutilize Generics, but this is not required. yield keyword also helps in implementing custom stateful iterations over a collection as discussed in [https://stackoverflow.com/questions/39476/what-is-the-yield-keyword-used-for-in-c/15977474#15977474 this SO discussion].
 
<syntaxhighlight lang="csharp">