Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (sz > size())
- insert(end(), sz-size(), c);
- else if (sz < size())
- erase(begin()+sz, end());
- else
- ; //do nothing
- void clear()
- {
- erase(begin(), end());
- }
- iterator erase(iterator position);
- iterator erase(iterator first, iterator last);
- template<typename C> void shrinkContainer(C &container) {
- if (container.size() != container.capacity()) {
- C tmp = container;
- swap(container, tmp);
- }
- //container.size() == container.capacity()
- }
Add Comment
Please, Sign In to add comment