title: C++ typedef for templated class
body: <p>What's the best way to create an alias for a templated class in C++?</p>
  
  <pre><code>template&lt;typename T&gt;
  class Dummy1
  {
  public:
      Dummy1(T var) : myVar1(var) {
      }
      ~Dummy1() {
      }
  private:
      T myVar1;
  };
  </code></pre>
  
  <p>C style would be:</p>
  
  <pre><code>typedef Dummy1&lt;int&gt; DummyInt;
  </code></pre>
  
  <p>In C++, as far as I know, I would write:</p>
  
  <pre><code>class DummyInt : public Dummy1&lt;int&gt; 
  {
      DummyInt(int a) : Dummy1&lt;int&gt;(a) { }
      ~DummyInt() { }
  }
  </code></pre>
  
  <p>Is there a better/shorter way? Cause this way when I inherit from the base, I have to declare the constructors every time.</p>
  
  <p>I need an alias for <code>Dummy1&lt;int&gt;</code> otherwise I need to use the template option through the entire code (like pointers and references). But I would like to <em>not</em> do this. </p>