title: C++/CLI: Implementing IList and IList<T> (explicit implementation of a default indexer)
body: <p>I am trying to implement a C++/CLI class that implements both <code>IList</code> and <code>IList&lt;T&gt;</code>.</p>
  
  <p>Since they have overlapping names, I have to implement one of them explicitly, and the natural choice should be IList.</p>
  
  <p>The implicit implementation of the indexer is:</p>
  
  <pre><code>using namespace System::Collections::Generic;
  generic&lt;class InnerT&gt; public ref class MyList : public System::Collections::IList, IList&lt;InnerT&gt; {
    // ...
    property InnerT default[int]{
      virtual InnerT get(int index);
      virtual void set(int index, InnerT item);
    }
  }
  </code></pre>
  
  <p>I am now trying to declare the default indexer for IList.</p>
  
  <p>My guess would be something like this:</p>
  
  <pre><code>  property Object^ System::Collections::IList::default[int]{
      virtual Object^ System::Collections::IList::get(int index);
      virtual void System::Collections::IList::set(int index, Object^ item);
    }
  </code></pre>
  
  <p>but that just gives me</p>
  
  <blockquote>
    <p>error C2061: syntax error : identifier 'default'</p>
  </blockquote>
  
  <p>Any hints?</p>