title: Delphi: generic and type constraints
body: <p>Is it possible to constrain the type of generic to, say, two different classes?</p>
  
  <p>Like so:</p>
  
  <pre><code>TSomeClass&lt;T: FirstClass; T: SecondClass&gt; = class
    // ...
  end;
  </code></pre>
  
  <p>(Sorry about the lack of formatting - the SO tool bar has disappeared from my browser).
  I know the above won't compile, its only written so to give you guys an idea. I tried</p>
  
  <pre><code>TSomeClass&lt;T: FirstClass, SecondClass&gt; = class
    // ...
  end;
  </code></pre>
  
  <p>but then I wasn't allowed to write</p>
  
  <pre><code>procedure TSomeClass.SomeMethod&lt;T&gt; (Param1: string);
  </code></pre>
  
  <p>Is this even possible?</p>