Looks like a silly question. But the comment on my answer to one of the SO questions made me think again.
[comment says that for an empty vector, the capacity should not be zero)
By default, my answer will be 0, since there are no elements inside the vector. It makes sense to keep the capacity as 0, and at the first placement it can be increased without any performance failures.
But the standard says nothing about it. (I also checked in the book of Josuttis).
Is this a purely concrete implementation? Does any STL manufacturer use any arbitrary number as a void for an empty vector?
Any thoughts ...
source
share