I instantiate an std::vector foo(1000)
.
foo.size()
is now 1000 and foo.capacity()
is also 1000.
If I clear the vector with foo.clear()
, the size()
is now 0, but what is the capacity()
? Does the standard say anything about that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…