title: Nonmember template function
body: <p>I have a templated class <code>pair</code>, and I'd like to write a <code>show</code> function <em>outside</em> of the class to do some fancy <code>cout</code>ing. When specifying the template type in <code>show</code> explictly, it all works as expected:</p>
  
  
  
  <pre><code>#include &lt;iostream&gt;
  
  template &lt;class A_Type&gt;
  class pair
  {
  public:
    A_Type a0;
    A_Type a1;
  };
  
  void show(const pair&lt;double&gt; &amp; p) {
    std::cout &lt;&lt; p.a0 &lt;&lt; std::endl;
    std::cout &lt;&lt; p.a1 &lt;&lt; std::endl;
  }
  
  int main() {
    pair&lt;double&gt; p;
    p.a0 = 1.2;
    p.a1 = 1.3;
  
    show(p);
  }
  </code></pre>
  
  <p>I'd like to have <code>show</code> oblivious of the template type though.</p>
  
  <p>Any hints?</p>