title: Add conversion constructor to specializaton of template
body: <h2>Background</h2>
  
  <p>I am implementing a special-purpose container for numbers.</p>
  
  <pre><code>template &lt;typename T&gt;
  class VectorBase
  {
      // Some constructors...
  
      friend VectorBase&lt;T&gt; operator+(const VectorBase&amp; a, const VectorBase&amp; b)
      {
          VectorBase&lt;T&gt; res;
          // Addition...
          return res;
      }
  
      // Additional non-trivial logic...
  }
  </code></pre>
  
  <p>It is then used for various types especially for double and float:</p>
  
  <pre><code>typedef VectorBase&lt;float&gt;    VectorFloat;
  typedef VectorBase&lt;double&gt;   VectorDouble;
  </code></pre>
  
  <p>Now I would like to use a construct like this</p>
  
  <pre><code>VectorFloat  inFloat;
  VectorDouble inDouble;
  
  VectorDouble outDouble = inFloat + inDouble;
  </code></pre>
  
  <p>Where I want to guarantee that the addition operation is executed on <code>double</code> objects and not on <code>float</code> ones to avoid precision problems. Exactly as it is done in pure C expressions.</p>
  
  <p>One way of achieving this is to first convert the <code>VectorFloat</code> object into <code>VectorDouble</code> and then perform the addition operation in the "double world". This can be done by hand (assigning the float variable into temporary double one) or automatically by the compiler into a temporary variable. To my knowledge, to do this, I need to have a parametric constructor or an assignment operator on the <code>VectorDouble</code> which takes an argument of type <code>VectorFloat</code> and does the actual conversion.</p>
  
  <h2>Question</h2>
  
  <p>Is it possible to add a new parametric constructor to a specialization of a template without the need of replicating the whole template code for a specific template parameter?</p>
  
  <pre><code>VectorBase&lt;double&gt;::VectorBase&lt;double&gt;(const VectorBase&lt;float&gt; &amp;b) { ... }
  </code></pre>
  
  <p>I know I can make a derived class which will contain the needed parametric constructor, but that will not work for me, since I need to derive another class from the <code>VectorBase</code> later on while still keeping it a template:</p>
  
  <pre><code>template&lt;typename T&gt;
  class VerySpecialDerivedVector: public VectorBase&lt;T&gt; { ... };
  </code></pre>