Skip to Main Content
C# 5.0. Leksykon kieszonkowy. Wydanie III
book

C# 5.0. Leksykon kieszonkowy. Wydanie III

by Joseph Albahari, Ben Albahari
September 2013
Intermediate to advanced content levelIntermediate to advanced
208 pages
5h 19m
Polish
Helion
Content preview from C# 5.0. Leksykon kieszonkowy. Wydanie III

Enumeratory i iteratory

Enumeracja

Enumerator to kursor tylko do odczytu, przesuwany wyłącznie do przodu wzdłuż sekwencji wartości. Enumerator to równocześnie obiekt, który implementuje interfejs System.Collections.IEnumerator albo System. Collections.Generic.IEnumerator<T>.

Instrukcja foreach realizuje operację iterowania po obiekcie „przeliczalnym” (ang. enumerable). Taki obiekt to logiczna reprezentacja sekwencji wartości; sam w sobie nie jest kursorem, ale obiektem, który generuje kursor sam dla siebie. Obiekt przeliczalny to taki obiekt, który implementuje interfejs IEnumerable albo IEnumerable<T>, ewentualnie posiada metodę o nazwie GetEnumerator ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick

Publisher Resources

ISBN: 9781457178559