After a while, we get back to series dedicated to the internals of C# language. Personally, I think that previous part about iterators was quite longish and complicated, hence today I decided to choose a much simpler (but hopefully still interesting) subject- foreach statement. Foreach only with IEnumerable? Before we jump into more internal-ish stuff, I’d like to cover one thing which is quite interesting. When we go to the MSDN page about foreach statement...
Sztuka programowania 2480 dni, 5 godzin, 5 minut temu 154 źrodło rozwiń
In my last post, we got familiar with the internals of string switch statement in C#. Today, we are going to deeply understand another language feature – iterators. Iterators in C# Despite the fact that iterators (using yield keyword) were introduced back in C# 2.0, many folks are still confused how they work. Honestly, I’m not surprised at all, because to me this mechanism was a mystery for a long time. Of course, we have to clearly distinguish two things here:How do...
Sztuka programowania 2504 dni, 27 minut temu 152 źrodło rozwiń