The std::remove() function takes a begin and end iterator, and the object you want to remove. What this function does, when it finds the given item, is moving all next elements in the vector to the left, which overwrites the found item, but leaves one extra item at the end of the list. Once it's finished, it returns an iterator to the end of the list, minus the number of items removed.
Combining the two allows you to remove all found items, and then erase the leftover items at the end of the list, by calling std::vector::erase() with the iterator that std::remove() returned, and std::vector::end() as the end iterator. In the end, this saves you from writing search code, as std::remove() will find all occurences of the item you want to remove.
// Clear up the object that itemToBeRemoved pointed to:delete itemToBeRemoved;// Now erase that pointer from our vector of sprite pointers:spriteContainer.erase( std::remove( spriteContainer.begin(), spriteContainer.end(), itemToBeRemoved ), spriteContainer.end() );