title: outside class operator for template class inside template class
body: <p>I'm trying to write outside class template operator for template class inside template class.</p>
  
  <p>I hope the following snippet will explain what I mean.</p>
  
  <pre><code>enum MyEnum {};
  
  template &lt;MyEnum a&gt;
  class ClassWithTemplateClass {
   public:
      template &lt;bool B&gt; 
      class TemplateClass {
          // ...
      };
  };
  </code></pre>
  
  <p>When I wrote operator like this:</p>
  
  <pre><code>template &lt;MyEnum enumVal, bool B&gt;
  auto operator&lt;&lt;(ClassWithTemplateClass&lt;enumVal&gt;::TemplateClass&lt;B&gt; &amp;a, int b) {
      // ...
      return a;
  }
  </code></pre>
  
  <p>compiler returned error:</p>
  
  <p>error: declaration of 'operator&lt;&lt;' as non-function</p>
  
  <p>Can you tell me how I should write this operator?</p>