basic_string::reserve

void reserve(size_type n = 0);

The member function ensures that capacity() henceforth returns at least n.