June 2008
Intermediate to advanced
784 pages
20h 36m
English
Nongeneric enumerable objects and enumerators lack type specialty, which leads to performance problems and other issues. You can implement enumerable objects and enumerators using generic interfaces, which avoid some of the problems mentioned at the end of the previous section. Implement the IEnumerable<T> interface for generic enumerable objects. For generic enumerators, implement the IEnumerator<T> interface. Both IEnumerable<T> and IEnumerator<T> are generic interfaces found in the System.Collections.Generic namespace. IEnumerable<T> and IEnumerator<T> inherit their nongeneric counterparts IEnumerable and IEnumerator, respectively. This means the nongeneric methods must be implemented as well.
Generic ...
Read now
Unlock full access