Effects: If sz <= size(), equivalent to erase(begin() + sz, end());. If size() < sz, appends sz - size() value-initialized elements to the sequence.
Requires: T shall be DefaultConstructible.
void resize(size_type sz, const T& c);
Effects:
if (sz > size())
insert(end(), sz-size(), c);
else if (sz < size())
erase(begin()+sz, end());
else
; // do nothing
Requires: T shall be CopyInsertable into *this.
Remarks: shrink_to_fit is a non-binding request to reduce memory use. [ Note: The request is non-binding to allow latitude for implementation-specific optimizations. — end note ]