I have a vector of events, with the first one being a guard for easier computations. I have implemented a reset operation as follows:
void reset()
{
myVector.resize(1);
}
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?