I can\'t seem to think of a reliable way (that also compacts memory) to remove the first N elements from a std::vector. How would one go about doing that?
std::vector
Since you mention that you want to compact memory, it would be best to copy everything to a new vector and use the swap idiom.
std::vector(myvector.begin()+N, myvector.end()).swap(myvector);