title: Provide definition of constructor template outside a class template
body: <p>Consider the following class template with a constructor template:</p>
  <pre><code>template &lt;class T&gt;
  class C{
      public:
      T val_;
      std::string str_;
      
      template &lt;typename S&gt;
      C(const S&amp; str);
      // C(const S&amp; str) : str_(str) {}; // Valid definition of constructor within class body
      
      void print(){std::cout &lt;&lt; str_;}
  };
  </code></pre>
  <p>I'm, however, trying to define the constructor outside of the class, but I can't seem to figure out a way to account for the type <code>S</code>.</p>
  <pre><code>template &lt;typename T, typename S&gt; // incorrect as too many parameters
  C&lt;T&gt;::C(const S&amp; str) : str_(str) {};
  </code></pre>
  <p>Alternatively, I tried</p>
  <pre><code>template &lt;typename T&gt;
  C&lt;T&gt;::C(const std::string&amp; str) : str_(str) {};
  </code></pre>
  <p>which also does not work (and probably defeats the purpose of <code>S</code>)</p>
  <ol>
  <li>How can I correctly define this constructor outside the class.</li>
  <li>Does such a pattern (where class template parameters differ from constructor template parameters) serve any practical purpose? An example would be very helpful.</li>
  </ol>