title: How to prevent a template class from being derived more than once?
body: <p>I have the following template class:</p>
  
  <pre><code>template&lt;class I&gt;
  class T : public I
  {
      // ...
  };
  </code></pre>
  
  <p>This template class need to be derived once (and only once) for a given template parameter <code>I</code>.</p>
  
  <pre><code>class A : public T&lt;U&gt;  {};    // ok
  class B : public T&lt;V&gt;  {};    // ok
  class C : public T&lt;U&gt;  {};    // compile error
  </code></pre>
  
  <p>Template class <code>T</code> can be adapted to achieve such a behavior (while classes <code>A</code>, <code>B</code>, <code>U</code>, <code>V</code> cannot); however, <code>T</code> must not have any knowledge about derived classes <code>A</code>, <code>B</code>, <code>C</code>.</p>
  
  <p>Is there any way to prevent such a template class from being derived more than once? Ideally issuing a compilation error in such a case or, at least, a linker error.</p>