I\'m trying to delete everything from a std::vector by using the following code
std::vector
vector.erase( vector.begin(), vector.end() );
vector.clear() should work for you. In case you want to shrink the capacity of the vector along with clear then
vector.clear()
vector
std::vector(v).swap(v);