title: Is Delphi generic TInterfaceList possible?
body: <p>In Delphi 2010, I have defined a generic TInterfaceList as follows:</p>
  
  <pre><code>type
  
  TInterfaceList&lt;I: IInterface&gt; = class(TInterfaceList)
    function GetI(index: Integer): I;
    procedure PutI(index: Integer; const Item: I);
    property Items[index: Integer]: I read GetI write PutI; default;
  end;
  
  implementation
  
  function TInterfaceList&lt;I&gt;.GetI(index: Integer): I;
  begin
    result := I(inherited Get(Index));
  end;
  
  procedure TInterfaceList&lt;I&gt;.PutI(index: Integer; const Item: I);
  begin
    inherited Add(Item);
  end;
  </code></pre>
  
  <p>I haven't had any problems yet, but is there anything inherently risky about doing this?  Would it be possible to add an enumerator to it to allow for..in loops to work on it?  If there's nothing wrong with it, I wonder why something similar isn't already defined in the RTL.</p>