Enumerator.MoveNext() throws 'Collection was Modified' on first call
问题 Consider the following code: List<int> list = new List<int>(); IEnumerable<int> enumerable = list; IEnumerator<int> enumerator = enumerable.GetEnumerator(); list.Add(1); bool any = enumerator.MoveNext(); At runtime, the last line throws an: InvalidOperationException: Collection was modified; enumeration operation may not execute. I understand the need for IEnumerators to throw 'Collection was modified' exceptions when the IEnumerable changes, but I don't understand this: Why does the