Quote Originally Posted by mikoil View Post

Now assuming Option 1 is the correct one and this is really what happens internally, how would I avoid all this copying?
On suggestion, from what I understand, is to swap between "33" and "55", and then remove, then all the vector will do is cutting the array at the end, with no need to copy all.

Anyone follows?
Consider the std:eque as well.
http://www.cplusplus.com/reference/stl/deque/

You never did describe, in detail, what your custom class is. Therefore it is hard to imagine which container will work best for you. Also, you indicated that you are storing pointers to objects so I am unclear on what the fuss is all about with regards to copying and memory fragmentation. The list could work for you but again I am unclear on what your custom class is for. Lists have a more significant difference from vectors than do deques but that may not matter. I have no idea what your program does. Unless you tell us you'll have to analyze the three types of containers and figure it out.