Why enumerator structs are a really bad idea
- by Simon Cooper
If you've ever poked around the .NET class libraries in Reflector, I'm sure you would have noticed that the generic collection classes all have implementations of their IEnumerator as a struct rather than a class. As you will see, this design decision has some rather unfortunate side effects...
As is generally known in the .NET world, mutable…