title: Time-efficient std::vector::resize
body: <p>I have a vector of events, with the first one being a guard for easier computations. I have implemented a reset operation as follows:</p>
  
  <pre><code>void reset()
  {
      myVector.resize(1);
  }
  </code></pre>
  
  <p>so that only the first one element remains. Does this operation reallocate memory? I will call it in a loop, so I would like it to be very time-efficient. If it does, then what would be an efficient alternative?</p>