The problem with this is that the duplicate doesn't really contain answers that are satisfactory - specifically no reference to any C++ standard.
This is not a reason to avoid closing a duplicate question as a duplicate. Rather, it is a reason to improve or expand the answers to the existing question.
If you can improve GMan's answer by adding a quotation from the language standard, you should do so. If you have some even more to offer, you should post a new answer of your own. If you cannot answer the question, but think it deserves a better answer with reference to the language standard, you should set a bounty on the question and choose an appropriate reason. Leave a custom message, too, mentioning the standard reference that you seek.
Anecdotally, I've seen a couple of experts who are regularly active answering C++ questions express disagreement with the closure process. Their argument has been that a new question shouldn't be marked as a duplicate of an existing question because the answers to that old question are bad, misleading, incomplete, or otherwise problematic.
I do not understand this objection. If there is a problem with the answers to the original question, it should be remediated. Just because the question is old doesn't mean we should allow it to fester. The primary audience served by this site is arguably those who arrive here via Google (or another search engine) looking for answers to a similar problem of their own. Which answers do you think they'll see first? The bad ones to an old, popular question, or the good one to a new question? We don't sort by date.
What boggles my mind is that, at least one of the times that I saw this, the dissenting individual re-opened the proposed duplicate and posted an awesome answer. Jeez, if you can do that, why not just post it on the original question where everyone can see it and benefit? Why have misleading information in Exhibit A and correct information in Exhibit B?
It is guaranteed that no reallocation takes place during insertions that happen after a call to reserve() until the time when an insertion would make the size of the vector greater than the size specified in the most recent call to reserve()
. Does it not answer your question, especially coupled with the other answers?assign
but possibly notoperator=
.