title: Template classes with specialised constructors
body: <p>Consider the following contrived example of a templated array definition:</p>
  
  <pre><code>template &lt;typename t, unsigned int n&gt; class TBase
  {
  protected:
      t m_Data[n];
  
      //...
  };
  
  template &lt;typename t, unsigned int n&gt; class TDerived : public TBase&lt;t, n&gt;
  {
      TDerived()
      {
      }
  };
  </code></pre>
  
  <p>I can specialize this type to provide a non-default constructor for an array of length 2 as follows:</p>
  
  <pre><code>template &lt;typename t&gt; class TDerived&lt;t, 2&gt; : public TBase&lt;t, 2&gt;
  {
  public:
      TDerived(const t&amp; x0, const t&amp; x1)
      {
          m_Data[0] = x0;
          m_Data[1] = x1;
      }
  };
  
  int main()
  {
      TDerived&lt;float, 2&gt; Array2D_A(2.0f, 3.0f); //uses specialised constructor
      TDerived&lt;float, 3&gt; Array3D_A;             //uses default constructor
  
      return 0;
  }
  </code></pre>
  
  <p>Is there some other way I can create a class that has different constructor options constrained against template parameters at compile-time without the requirement for a complete class specialisation for each variation? </p>
  
  <p>In other words, is there some way I can have specialised constructors in the <code>TBase</code> class without the need for the intermediary step of creating <code>TDerived</code> whilst preserving the functionality of <code>TBase</code>?</p>