title: C++ - Use default template as base for specialization
body: <p>I want to write a math vector template. I have a class which accepts type and size as template argument, with a lot of math operation methods.
  Now I want to write specializations where Vector&lt;3> for instance has x, y, z as members which refer to data[0..3] respectively.</p>
  
  <p>The problem is that I don't know how to create a specialization which inherits everything from the default template without creating either a base class or writing everything twice.</p>
  
  <p>What's the most efficient way to do this?</p>
  
  <pre><code>template&lt;class Type, size_t Size&gt;
  class Vector {
      // stuff
  };
  
  template&lt;class T&gt;
  class Vector&lt;3,T&gt;: public Vector {
      public:
          T &amp;x, &amp;y, &amp;z;
          Vector(): Vector&lt;&gt;(), x(data[0]), y(data[1]), z(data[2]){}
          // and so on
  };
  </code></pre>