Possible Duplicate:
std::vector resize downward
If I resize() an std::vector to some size smaller than its current size, is it possible that the vector will ever allocate new memory?
This is important to me for performance reasons.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No,
resizeing to a smaller size will never reallocate.(From here)
Given that, we can be sure that a reallocation cannot have happened.