title: Template friendship
body: <p>I'm trying to access protected variables of a template class with different template parameters. A friend declaration with template parameters is giving the following error:</p>
  
  <p><em>multiple template parameter lists are not allowed</em></p>
  
  <p>My code is</p>
  
  <pre><code>template&lt;class O_, class P_&gt; 
  class MyClass {
      //multiple template parameter lists are not allowed
      template&lt;class R_&gt; friend class MyClass&lt;R_, P_&gt; 
      //syntax error: template&lt;
      friend template&lt;class R_&gt; class MyClass&lt;R_, P_&gt; 
  
  public:
      template&lt;class R_&gt;
      ACopyConstructor(MyClass&lt;R_, P_&gt; &amp;myclass) :
         SomeVariable(myclass.SomeVariable)
      { }
  
  protected:
      O_ SomeVariable;
  };
  </code></pre>
  
  <p>If I remove the protection and friend declaration it works.</p>