What you did is already correct.. the reserve allowed it to survive the clear..
Your vector will have a size of 0 but a capacity of 10000. All information in the vector is lost and cannot be accessed. If an access is attempted, it will assert out of range. Basically it will crash your program if you try to access a position in the vector for any type that is not integral.
vector<string>
being accessed will crash your program.vector<int/short/double/long>
being accessed will not crash your program, but every value in the vector will be 0.
for (int I = 0; I < myVector.size(); I++) //Will do NOTHING if you have cleared it.
for (int I = 0; I < myVector.capacity(); I++) //Will do 10000 iterations based on your reserved size.
Now I do not currently have a compiler with me to test with iterators so i'm not sure how that would work but I'm sure you can test it:
for (std::vector<T>::iterator it = myVector.begin(); it != myVector.end(); ++it
or something of the sort.