will a call to std::vector.clear() also set the std::vector.reserve() to zero?
Posted
by monkeyking
on Stack Overflow
See other posts from Stack Overflow
or by monkeyking
Published on 2010-04-13T09:17:39Z
Indexed on
2010/04/13
9:23 UTC
Read the original article
Hit count: 304
If I use .reserve(items) on a vector, the vector will allocate enough memory for my guess of the number of items that I'll need.
If I later on use .clear(), will that just clear the vector or save my earlier defined reserve?
thanks.
© Stack Overflow or respective owner