title: Overload indexer to have foreach'able class
body: <p>I tried to do something like this but this doesn't work:</p>
  
  <pre><code>    class Garage
      {
          private List&lt;Car&gt; cars = new List&lt;Car&gt;();
  
          public Car this[int i]
          {
              get { return cars[i]; }
          }
           //...
      }
  
         Garage g =  new Garage();
         //get CS1579 - no GetEnumerator definition
         foreach (Car c in g)
         {
             //...
         }
  </code></pre>
  
  <p>As MSDN says indexers can be overloaded, so I decided to ask experts here. How to overload indexers to cooperate with <code>foreach</code> loop?</p>