title: C++, templatize T in std::pair <T, short>
body: <p>I would like to templatize "first" type of std::pair using the following construction</p>
  
  <pre><code>template &lt;typename T&gt;
  struct TPair
  {
  typedef std::pair &lt;T, short&gt; Type;
  };
  </code></pre>
  
  <p>and create a vector of such pairs.</p>
  
  <pre><code>template &lt;typename T&gt;
  struct TPairs
  {
  typedef std::vector &lt;TPair &lt;T&gt; &gt; Type;
  };
  </code></pre>
  
  <p>But this code seems to be screwed for common usage and it is uncomfortable:</p>
  
  <pre><code>TPair &lt;double&gt; ::Type my_pair (1.0, 0 ); //Create pairs
  TPair &lt;double&gt; my_pair2 (1.0, 0 ); //Create object, needs a constructor
  
  TPairs &lt;double&gt; ::Type pairs; //Create vector
  TPairs &lt;double&gt; pairs2; //Create object
  
  pairs.push_back(my_pair); //Need a constructor
  pairs2.push_back(my_pair); //No push_back method for the structure...
  ....
  </code></pre>
  
  <p>Is there any more simple and comfortable solution?</p>