title: Compiler not creating templated ostream << operator
body: <p>I have a class, defined in a head as:</p>
  
  <pre><code>template &lt;typename T&gt; class MyClass
  {
     template &lt;typename U&gt; friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; output, const MyClass&lt;U&gt;&amp; p);
     public:
        ...
  }
  </code></pre>
  
  <p>In an implementation file, I have:</p>
  
  <pre><code>template &lt;typename U&gt; std::ostream&amp; operator&lt;&lt;(std::ostream&amp; output, const MyClass&lt;U&gt;&amp; m)
  {
     output &lt;&lt; "Some stuff";
     return output;
  }
  </code></pre>
  
  <p>Which all looks fairly kosher. However, when I try and use this operator (i.e. std::cout &lt;&lt; MyClass()), I get the following linker error:</p>
  
  <pre><code>Undefined symbols: std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; operator&lt;&lt; &lt;InnerType&gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, MyClass&lt;InnerType&gt; const&amp;)
  </code></pre>
  
  <p>I am suprised the compiler hasn't automagicially generated this for me... Any suggestions as to what I'm doing wrong?</p>