list::resize

void resize(size_type n, T x = T());

The member function ensures that size() henceforth returns n. If it must make the controlled sequence longer, it appends elements with value x.