You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The final line will only reallocate memory if svec.size() + svec.size / 2 > svec.capacity(). Regardless of whether reallocation occurs, the final line will change the size of the vector so that it is half-again (rounded down) the size it was before, and the elements added to the back of the vector to expand the size will be initialized to empty strings.
I think this is what you were trying to say, but the way it is worded says something entirely different.
The text was updated successfully, but these errors were encountered:
The final line will only reallocate memory if
svec.size() + svec.size / 2 > svec.capacity()
. Regardless of whether reallocation occurs, the final line will change the size of the vector so that it is half-again (rounded down) the size it was before, and the elements added to the back of the vector to expand the size will be initialized to empty strings.I think this is what you were trying to say, but the way it is worded says something entirely different.
The text was updated successfully, but these errors were encountered: