title: Can I add a value to a vector without pushing it?
body: <p>Is there any way I can create a vector pair like this</p>
  
  <pre><code>  std::vector&lt;std::pair&lt;std::string, int&gt;&gt; myReg;
  </code></pre>
  
  <p>Then adding it like this:</p>
  
  <pre><code>  myReg[0].first = "title of the movie";
    myReg[0].second = 1968;
    myReg[1].first = "title of the 2nd movie";
    myReg[1].second = 2008;
  </code></pre>
  
  <p>As is it gives me a </p>
  
  <blockquote>
    <p>Debug assertion Failed</p>
  </blockquote>
  
  <p>Without using this:</p>
  
  <pre><code>myReg.push_back(std::pair&lt;std::string, int&gt;("title of the movie", 1968));
  </code></pre>