A
Adam Badura
In MSDN (August 2006) in the specification of IEnumerator.Current there
is word on exceptions. InvalidOperationException shall be thrown in case
"The collection was modified after the enumerator was created.". But in the
remarks section it can be read that "If the collection is modified between
MoveNext and Current, Current returns the element that it is set to, even if
the enumerator is already invalidated."
For me both this sentances seem to be contradictory. Or am I mistaken?
Also another intersting thing. IEnumerator<T> does not specify
exceptions at all. In remarks section it says only when Current is
undefined.
Framework doesn't seem to do checks at all.
Adam Badura
is word on exceptions. InvalidOperationException shall be thrown in case
"The collection was modified after the enumerator was created.". But in the
remarks section it can be read that "If the collection is modified between
MoveNext and Current, Current returns the element that it is set to, even if
the enumerator is already invalidated."
For me both this sentances seem to be contradictory. Or am I mistaken?
Also another intersting thing. IEnumerator<T> does not specify
exceptions at all. In remarks section it says only when Current is
undefined.
Framework doesn't seem to do checks at all.
Adam Badura