title: What should I do when inheriting IDisposable with nothing to dispose?
body: <p><a href="http://msdn.microsoft.com/en-us/library/78dfe2yb%28v=vs.110%29.aspx" rel="nofollow"><code>IEnumerator&lt;T&gt;</code></a> inherits <a href="http://msdn.microsoft.com/en-us/library/system.idisposable%28v=vs.110%29.aspx" rel="nofollow"><code>IDisposable</code></a> and I have to implement <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.dispose(v=vs.110).aspx" rel="nofollow"><code>Dispose</code></a> even though I have nothing to dispose. Should I still go through the motions?</p>
  
  <pre><code>public sealed class NothingEnumerator&lt;T&gt; : IEnumerator&lt;T&gt;
  {
      private bool disposed;
  
      public object Current
      {
          get
          {
              if (disposed) throw new ObjectDisposedException("NothingEnumerator");
              return default(T);
          }
      }
  
      public void Dispose()
      {
          disposed = true;
      }
  
      public bool MoveNext()
      {
          if (disposed) throw new ObjectDisposedException("NothingEnumerator");
          return false;
      }
  
      public void Reset()
      {
          if (disposed) throw new ObjectDisposedException("NothingEnumerator");
      }
  }
  </code></pre>
  
  <p>Or not?</p>
  
  <pre><code>public sealed class NothingEnumerator&lt;T&gt; : IEnumerator&lt;T&gt;
  {
      public object Current
      {
          get { return default(T); }
      }
  
      public void Dispose()
      {
      }
  
      public bool MoveNext()
      {
          return false;
      }
  
      public void Reset()
      {
      }
  }
  </code></pre>
  
  <p>In other words, do "disposed" objects <em>have</em> to throw?</p>