   Fast triangle/vertex creation and deletion
  I'm implementing the marching tetrahedron algorithm to generate the mesh for terrain. I'm planning on using this for a real-time terrain editor like in the Crysis level editor. I'm using a hash map for my vertices so I can save on memory, but when I go to draw my mesh, I'll need to have an array of vertices. I don't want to have to copy every single vertex into an array and create a copy of every triangle to make the indices match up with the new array each frame. I need to somehow keep an updated list of triangles and indices. What would be the fastest way to do this? The data has to be in arrays to pass off to graphics, but I will be adding and removing things all the time.EDIT ( idea ) : What if I used a hash map to store each set of triangle indices paired with an offset into the array of indices? When I remove a triangle, I could swap the three indices with the three on the end and then pop_back. My only problem is that I can't really pull the same thing off with the vertices because the hash map of offsets to the vertex array would change.   
  Would move semantics help you?   ;  Somewhat interesting, but ordering sort of matters in my case.   