title: Remove an element from vector and change the size
body: <p>I try to remove elements from a vector and it works fine with the erase() methode, but after removing the element the size of the vector still the same.</p>
  
  <pre><code>std::vector&lt;int&gt; myvector;
  myvector.push_back (1);
  myvector.push_back (2);
  myvector.push_back (3);//here the size is 3
  myvector.erase(myvector.begin()+1);//I think normally the size should be 2 after removing the element
  </code></pre>
  
  <p>is there a function that can do that or should I do it manually, I'm new to c++ I checked the documentation and I didn't found a solution for this.</p>