I have a vector with 1000 \"nodes\"
if(count + 1 > m_listItems.capacity())
m_listItems.reserve(count + 100);
The problem is I also
vector- (m_listItems).swap(m_listItems);
will shrink m_listItems
again: http://www.gotw.ca/gotw/054.htm (Herb Sutter)
If you want to clear it anyway, swap with an empty vector:
vector- ().swap(m_listItems);
which of course is way more efficient. (Note that swapping vectors basicially means just swapping two pointers. Nothing really time consuming going on)