Whats the most efficient way to remove the first element from a large vector?
<p>Say I have a vector with 100000 elements, and I wish to iterate through the vector, one by one, whilst copying the element into a map of some sort, but during each iteration, deleting the element from the vector - what is the most efficient way to do this?</p>

<p>Whilst iterating through the vector, I had done something like "it = vec.erase(it)" but it takes absolutely ages to complete. Is there not a quicker way? And as a side note, ordering is very important...</p>