Disclaimer: I understand the difference between IEnumerable
and IEnumerator
and how to use both. This is not a dupl
The two interfaces each represent very different concepts. IEnumerable<T>
is something that "allows enumeration", where IEnumerator<T>
is the representation of the enumeration itself.
If you were to merge these together, it would be impossible to enumerate a single collection more than once at the same time (without some other mechanism in place). For example, two threads doing a foreach
over an array would no longer work, where that is perfectly acceptable in the current design.