IEnumerator: Is it normal to have an empty Dispose method?
Posted
by C. Ross
on Stack Overflow
See other posts from Stack Overflow
or by C. Ross
Published on 2010-06-17T12:35:53Z
Indexed on
2010/06/17
12:43 UTC
Read the original article
Hit count: 193
I'm writing an IEnumerator<T>
class to iterate over a COM collection I'm wrappering. I've noticed that IEnumerator<T>
extends IDisposable
, so I'm required to implement the Dispose
method.
However, I can't think of anything I would put there, as I only have a reference to the collection (which I wouldn't want being disposed at the end of a foreach
), and an int
for the index. Is it normal to leave the Dispose
method empty?
© Stack Overflow or respective owner