Quote Originally Posted by anonytmouse
It works, but is it guaranteed to work? Does the standard guarantee that a vector iterator is a pointer or is this an implementation detail? Calling erase on an item in the middle or beginning of a vector is an expensive operation, as all subsequent elements must be moved. If you need to add and remove elements from the beginning or middle of a container, you should consider another container type.

i'm not arguing that my ingenius, super hackish way of erasing an element is the correct way. hell, look at the thread title. i am saying that it DOES work. i would not go into a job interview and do it that way, that's for sure.

a vector is fine. i only need to erase a pointer here and there. it won't happen more than, on average, about 0.5 times per program execution and it only will contain about 6 (pointer) elements tops. i'm not to concerned with it's efficiency.