title: Making a template parameter a friend?
body: <p>Example:</p>
  
  <pre><code>template&lt;class T&gt;
  class Base {
  public:
      Base();
      friend class T;
  };
  </code></pre>
  
  <p>Now this doesn't work... Is there a way of doing this?</p>
  
  <p>I'm actually trying to make a general class sealer like this:</p>
  
  <pre><code>class ClassSealer {
  private:
     friend class Sealed;
     ClassSealer() {}
  };
  class Sealed : private virtual ClassSealer
  { 
     // ...
  };
  class FailsToDerive : public Sealed
  {
     // Cannot be instantiated
  };
  </code></pre>
  
  <p>I found this example on this site somewhere but I can't find it... (<a href="https://stackoverflow.com/questions/656224/when-should-i-use-c-private-inheritance/656523#656523">here</a>)</p>
  
  <p>I know there are <a href="http://www.gamedev.net/reference/programming/features/cppseal/" rel="noreferrer">other ways</a> of doing this but just now I'm curious if you actually can do something like this.</p>