Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(count + 1 > m_listItems.capacity())
- m_listItems.reserve(count + 100);
- m_listItems.clear();
- vector<Item>(m_listItems).swap(m_listItems);
- vector<Item>().swap(m_listItems);
- std::vector<foo> v(1000); // Create a vector with capacity for 1000 elements
- std::vector< int > v;
- // ... fill v with stuff...
- std::vector< int >().swap( v );
- vector< int > tmp;
- old.swap( tmp );
Add Comment
Please, Sign In to add comment