You can avoid the extra variable.
v.push_back(v[itemIndex]); v.erase(v.begin() + itemIndex);
If you often delete from the middle of the vector and can rewrite your code so that it does not require random access, you can increase efficiency by using the linked list ( std::list ).
Brian source share