Wednesday, August 18, 2010

#2.5 Usings and Enumerators

One more thing regrading using. Do not forget, that IEnumerator<T> is IDisposable (though, IEnumerator is not).
public interface IEnumerator<T> : IDisposable, IEnumerator
{
  // Properties
  T Current { get; }
}


* This source code was highlighted with Source Code Highlighter.


So do not forget to enclose GetEnumerator() calls to using statement.

No comments:

Post a Comment